ReferenceSignals

hooksignal

Installs a per-connection filter for supported local signal callbacks.

Syntax

hooksignal(signal: RBXScriptSignal, callback: function) -> ()

Also available as

hook_signal

Parameters

ParameterTypeDescription
signalRBXScriptSignalSignal to filter.
callbackfunctionFilter receiving info followed by event arguments.

Description

The callback receives an info table and the event arguments. Info contains Connection, Function, Signal and Index. Return true to allow the original connection’s invocation; other returns skip it. Newly connected listeners can run once before the hook takes them over. Game-owned core connections are not taken over. Installing another hook replaces the filter. Use restoresignal to remove it.

Example

local event = Instance.new("BindableEvent")
event.Event:Connect(function(value) print(value) end)
hooksignal(event.Event, function(info, value) return true end)
event:Fire("hello")
restoresignal(event.Event)
event:Destroy()

These are Game executor contracts. Check build requirements and session lifetimes before using them.