Metatables
getrawmetatable
Returns the metatable currently attached to a target value, or nil when none is present. The function returns exactly one value and does not change the target. debug.getmethods is an alias for getrawmethods.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Returns the metatable currently attached to a target value, or nil when none is present. The function returns exactly one value and does not change the target. debug.getmethods is an alias for getrawmethods.
getrawmetatable(target: any): table | nil
debug.getmetatablelocal target = {}
local meta = {
label = "Real",
}
setrawmetatable(target, meta)
print(getrawmetatable(target) == meta)
print(debug.getmetatable(target) == meta)