hookmetamethod, returning the object’s metatable to
its original behavior for that metamethod.
Parameters
any
required
The value whose metamethod was hooked.
string
required
The metamethod name to restore.
Returns
boolean
true if a hooked metamethod was found and restored, false if there was
nothing to restore.Behavior
- Returns
false(rather than erroring) when the named metamethod is absent or was never hooked. - Readonly metatables are restored without being left writable, matching how
hookmetamethodinstalled the hook.
Example
Errors
Related
hookmetamethod: install the hook this undoes.