restorefunction Synchronous
restoreclosurerestorefunc
Remove an installed function hook and return calls to the preceding implementation. Call it during cleanup so a temporary observation or override does not outlive your script.
Luau
restorefunction(target: Function) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
target | Function | The original hooked function, not the preceding callable returned by hookfunction. |
Returns
()No value.
Example
Luau
local target = newcclosure(function() return "original" end)
local previous
previous = hookfunction(target, function() return "temporary" end)
print(target()) -- temporary
restorefunction(target)
print(target()) -- original