issignalhooked Synchronous

Check whether hooksignal currently intercepts a Roblox event. It is useful before replacing a hook or during cleanup when several scripts may touch the same signal.

Syntax
Luau
issignalhooked(signal: RBXScriptSignal) -> boolean

Parameters

Function parameters
ParameterTypeDescription
signalRBXScriptSignalRBXScriptSignal to check.

Returns

boolean

true if the signal has an active hook; false otherwise.

Usage notes

The check uses the underlying signal identity, so a newly obtained wrapper reports the same state. Passing something other than an RBXScriptSignal raises an error.

Example

Example
Luau
local event = Instance.new("BindableEvent")
print(issignalhooked(event.Event)) -- false

hooksignal(event.Event, function()
    return true
end)
print(issignalhooked(event.Event)) -- true

restoresignal(event.Event)
print(issignalhooked(event.Event)) -- false
event:Destroy()