Debug

getreg

Returns the Luau registry table exposed to the executor.

Syntax

getreg(): table
Aliases getregistrydebug.getregdebug.getregistry

Returns

NameTypeDescription
registrytableLuau registry table.

Description

Returns the Luau registry table exposed to the executor.

Call it without parameters. The function reads the needed context from the current runtime state.

It returns registry (table). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getreg()
print(result)