ReferenceEnvironment
Reach the game's and the executor's global tables, the registry and the garbage collector.
Also available as filter_gc
Searches the garbage collector's values and returns only those matching a filter, such as functions with a given name, constant or upvalue, or tables with given keys. It is faster and more precise than filtering the result of getgc yourself.
Also available as get_fflag
Reads the current value of a fast flag (an engine tuning setting) by name and returns it as text.
Also available as get_gc
Returns a list of the values the garbage collector currently tracks. By default it returns only functions; pass true to include tables, userdata and threads as well.
Also available as get_genv
Returns the executor's global table. Values you put here are visible to every script you run in the same session, and are not visible to the game's own scripts.
function getgenv(): { any }
Also available as getregistry debug.getregistry get_reg get_registry
Returns the Lua registry, the internal table that holds threads, functions and other values the runtime keeps alive. Useful for finding objects that no script references directly.
function getreg(): { [any]: any }
Also available as get_renv
Returns the game's own global table, the one the game's scripts see. Reading it shows what the game has defined; writing to it changes what game scripts see.
function getrenv(): { any }
Also available as get_tenv
Returns the global environment of a given thread. With no argument it returns the current thread's.
Also available as set_fflag
Sets a fast flag by name. The name and value are both given as text. Some flags only take effect if set before the game starts using them.