Skip to content
Saiko

restorefunction

Undoes a hook applied with hookfunction or hookmetamethod and restores the original implementation.

Signature

luau
restorefunction(fn: (...any) -> ...any): ()

Parameters

fnfunction

The hooked function to restore.

Returns

Nothing.

Example

luau
local original = print
hookfunction(print, function() end)
print("this prints nothing")

restorefunction(print)
print("this prints again", print == original)