Skip to content
Functions & closuresReference

restoresignal

Represents restoration of signal callback behavior.

Details#

Removes the module's hook from a signal and restores saved handler behavior. Pass the same signal used for hooksignal; disconnecting an individual connection is a different operation.

Signature#

Luau
restoresignal(signal: RBXScriptSignal): boolean

Parameters#

ParameterTypeDescription
signalRBXScriptSignalEngine signal, not a connection or local Signal facade.

Returns#

true when a saved signal interception was removed, otherwise false.

Examples#

Example

Luau
local event = Instance.new("BindableEvent")
local connection = event.Event:Connect(function(value) print(value) end)
hooksignal(event.Event, function(metadata, value) return true, value end)
print(restoresignal(event.Event))
event:Fire("restored")
task.defer(function() connection:Disconnect(); event:Destroy() end)