hookmetamethod
function hookmetamethod(object: table | Instance | userdata, metamethod_name: string, hook: (...any) -> (...any)): (...any) -> (...any)Parameter
Example
local Original; Original = hookmetamethod(game, "__index", function(...)
local Key = select(2, ...)
print(Key)
return Original(...)
end)
local _ = game.PlaceId
hookmetamethod(game, "__index", Original) -- Restores game's __index
-- Output: PlaceIdLast updated