restorefunction
Restores a function or registered metamethod hook.
The alias restorefunctions still takes one function, not an array.
restorefunction(target: function): ()Parameters
| Parameter | Type | Description |
|---|---|---|
target | function | Hooked function to restore. |
Example
local function target() return "original" end
hookfunction(target, function() return "replacement" end)
restorefunction(target)
print(target())Example output
originalIf no hook is recorded for target — because it was never hooked, or was already restored, or a mutual hook cycle collapsed back to the original — the call is a no-op and does not raise. restorefunction is therefore safe to call repeatedly.
Aliases: restorefunctions, restorefunc.
