Skip to main content

RemoveFunctionHook

This function was added in DSL 6

Description

Remove a hook registered with HookFunction. Keep in mind that hooks are automatically removed when your script dies, so you do not need to call this manually.

function RemoveFunctionHook(hook) --[[ ... ]] end

Parameters

  • hook: userdata - The handle to the hook you want to remove. This is the value returned by HookFunction.

Return Values

None.

Example

local hook = HookFunction('GetPlayerName', function(args, results, isReplacement)
print('GetPlayerName called with args:', args)
if isReplacement then
print('This was a replacement function.')
else
print('This was the original function.')
end
end)
-- Later, you can remove the hook if needed
RemoveFunctionHook(hook)

See Also