Atomic docs

hookmetamethod

hookmetamethod(object: any, method: string, hook: function): function

Hooks one metamethod and returns the original.

Example

lua
local old
old = hookmetamethod(game, "__index", function(self, key)
    return old(self, key)
end)
↑