ReferenceEnvironment

getrenv

Returns a view that resolves names through the game's global environment.

Syntax

getrenv() -> table

Also available as

get_renv

Returns

TypeDescription
tableA 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

These are Game executor contracts. Check build requirements and session lifetimes before using them.