restorefunction
Removes an active function hook.
Syntax
Signature
restorefunction(Target: function) -> ()Aliases
restorefunc
Parameters
| Parameter | Type | Description |
|---|---|---|
Target | function | Function previously passed as the target of hookfunction. |
Returns
| Type | Description |
|---|---|
() | None. |
Notes
Raises an error if Target has no active hook in this VM.
Example
Luau
local Function = function() return 1 end
hookfunction(Function, function() return 2 end)
restorefunction(Function)
assert(Function() == 1)