APEX docs
Reference

Metatables

Raw metatables, read-only tables and the current namecall method.

getnamecallmethod

Also available as get_namecall_method

Inside a __namecall hook, returns the name of the method being called, such as "FireServer".

function getnamecallmethod(): string?

getrawmetatable

Also available as debug.getmetatable get_raw_metatable

Returns an object's real metatable, even if a __metatable field would normally hide it.

function getrawmetatable(object: { any } | userdata): { [any]: any } | nil

isreadonly

Also available as is_read_only

Returns true if the table is read-only.

function isreadonly(table: { any }): boolean

setnamecallmethod

Also available as set_namecall_method

Inside a __namecall hook, changes the method name the call will use.

setrawmetatable

Also available as debug.setmetatable set_raw_metatable

Replaces an object's metatable, even when the metatable is protected. Returns the object.

function setrawmetatable<T>(object: T & ({ any } | userdata), metatable: { any }): T

setreadonly

Also available as set_read_only

Turns a table's read-only flag on or off. A read-only table raises an error on write; turn it off to modify game tables.

function setreadonly(table: { any }, state: boolean): ()