restoresignal Synchronous

Remove a hooksignal interception and return the event’s Lua listeners to their original callbacks. Use it when a temporary inspection or argument rewrite is done.

Syntax
Luau
restoresignal(signal: RBXScriptSignal) -> ()

Parameters

Function parameters
ParameterTypeDescription
signalRBXScriptSignalRBXScriptSignal whose active hook should be removed.

Returns

()

No values.

Usage notes

Restoring an unhooked signal has no effect. A fresh wrapper for the same underlying Roblox event also identifies the hook.

Connections made while the hook was active are restored too. Existing Wait calls finish according to the state of the hook when their next event arrives.

Example

Example
Luau
local event = Instance.new("BindableEvent")
local listener = event.Event:Connect(function(value)
    print(value)
end)

hooksignal(event.Event, function(_, value)
    return true, value .. " (edited)"
end)
event:Fire("first")
task.wait()

restoresignal(event.Event)
event:Fire("second") -- original listener receives second
task.wait()
listener:Disconnect()
event:Destroy()