getrenv
Returns a view that resolves names through the game's global environment.
Syntax
getrenv() -> table
Also available as
get_renv
Returns
| Type | Description |
|---|---|
table | A view of the current game's global environment. |
Description
Inherited names resolve to the game's library tables and functions. The view itself does not contain raw copies of those names: rawget(getrenv(), "game") can be nil while getrenv().game is available. Assigning a new field to the view does not replace that field in the underlying game globals. Mutating an inherited table, such as getrenv().math, does mutate that shared table.
Example
local renv = getrenv()
print(renv.game == game)
print(renv.loadstring ~= loadstring)
renv._G.FromExecutor = true
Notes
- The view exposes the native _G and shared tables separately from Apex's _G and shared. Restore any shared library or native table you modify.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
