getrawmetatable(value: any) → table?
Metatable ignoring the
__metatable field.
lua
local mt = getrawmetatable(game) print(mt.__namecall)
setrawmetatable(value: any, mt: table) → any
Replace the metatable (bypasses
__metatable protection).
lua
local t = setmetatable({}, { __metatable = "locked" }) setrawmetatable(t, { __index = function() return 0 end })
setreadonly(t: table, readonly: boolean)
Set the readonly flag on a Luau table.
lua
local mt = getrawmetatable(game) setreadonly(mt, false) mt.__namecall = function() end setreadonly(mt, true)
isreadonly(t: table) → boolean
Whether the table is currently readonly.
lua
print(isreadonly(getrawmetatable(game))) --> true
makewriteable(t: table)
Shorthand for
setreadonly(t, false).
lua
makewriteable(getrawmetatable(game))
makereadonly(t: table)
Shorthand for
setreadonly(t, true).
lua
makereadonly(myTable)
getnamecallmethod() → string?
Inside a
__namecall handler, the method name being invoked.
lua
hookmetamethod(game, "__namecall", function(self, ...) if getnamecallmethod() == "Kick" then return end return oldNamecall(self, ...) end)
setnamecallmethod(name: string)
Rewrite the namecall method name.
lua
-- inside a __namecall hook, redirect Kick → Chat if getnamecallmethod() == "Kick" then setnamecallmethod("Chat") end