Restores a function that was hooked with hookfunction, returning it to its original behavior. Also registered as restorefunc.

Parameters

function
required
The hooked function to restore.

Behavior

  • Restoring a function that is not hooked is a no-op. It does not error.
  • After restoring, isfunctionhooked reports false for the function.
  • If the function was hooked as part of a metamethod hook, restorefunction also resolves that case, so you do not need to track which path installed it.

Example

Errors