getrawmetatable Synchronous
Read an object’s actual metatable, even when normal metatable access is protected. Use it to inspect metamethods such as __index or __tostring.
Luau
getrawmetatable(value: any) -> Table?Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value whose metatable should be inspected. |
Returns
Table?The raw metatable, or nil when there is none.
Example
Luau
local object = setmetatable({}, { __tostring = function() return "item" end })
local meta = getrawmetatable(object)
print(type(meta.__tostring)) -- function