Returns the raw metatable of object, even when __metatable is set.
If the __metatable metamethod is set, getmetatable returns that value instead of the actual metatable itself. getrawmetatable skips that lock, and returns the metatable directly.
Most commonly used to grab the game’s __index or __namecall metamethods so you’re able to hook them.
Parameters
Returns
table? - the metatable of object, or nil if it has none. The returned table is the source’s metatable - not a copy. Editing the metatable mutates the live source.
Example
Anticheats and antitampers set __metatable on their own tables to hide the real metatable from getmetatable. getrawmetatable reads past that lock, so you can still see and hook what they protect.