VINDICTA.TOP
Metatables · Function
Bunni.fun
ChocoSploit
Cryptic
Potassium
Seliware
SirHurt
Solara
Velocity
Volcano
Volt
Wave
Xeno

setrawmetatable

Sets the metatable of an object, bypassing __metatable guards.

function setrawmetatable(objectobjectanyThe object whose metatable to replace.: any, newMtnewMttable?The new metatable, or nil to remove it.: table?): anyanyThe original object (for chaining).

Usage

Override a locked metatable
local mt = getrawmetatable(game)
setreadonly(mt, false)
mt.__index = function(self, key)
	print("Index:", key)
	return rawget(mt, key)
end
setreadonly(mt, true)