getreg
Returns the Luau registry, the table the engine uses to keep values alive on its own behalf.
Syntax
getreg() -> table
Also available as
getregistrydebug.getregistryget_regget_registry
Returns
| Type | Description |
|---|---|
table | The Luau registry table. |
Description
The registry holds the game's threads, functions referenced by the engine, signal callbacks and other internal values. It is mostly useful for finding things no global or script variable points to.
Example
local threads = 0
for _, value in getreg() do
if type(value) == "thread" then
threads += 1
end
end
print(threads, "threads in the registry")
Notes
- Do not remove or replace registry entries you did not add; the engine depends on them. This is the real VM registry, including Apex's own helper tables and closure references. Function publication settings are not a security boundary while raw registry and GC/debug introspection are available. Internal bookkeeping keys and cache keys can contain native pointer values; do not print or transmit them.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
