getconnections Synchronous
get_signal_cons
Inspect the live listeners attached to a Roblox event. This is useful when tracing why an event fires more than once or temporarily controlling a particular listener.
Luau
getconnections(signal: RBXScriptSignal) -> {Connection}Parameters
| Parameter | Type | Description |
|---|---|---|
signal | RBXScriptSignal | RBXScriptSignal whose listeners you want to inspect. |
Returns
{Connection}An array of Connection objects. Each object exposes Enabled, Fire, Defer, Disconnect, Disable, and Enable.
Luau
Connection = {
Enabled: boolean, ForeignState: boolean, LuaConnection: boolean,
Function: Function?, Thread: thread?
}Usage notes
The array describes connections present when the function runs. It does not include callbacks attached later. A Connection object controls its original listener, so be careful when disabling game-owned callbacks.
Function and Thread come from live callback slots in the current VM. For listeners owned by another VM, those fields can be nil even though the connection is present.
Example
Luau
local signal = game:GetService("Players").PlayerAdded
for index, connection in ipairs(getconnections(signal)) do
print(index, connection.Enabled)
end