getconnections
Lists observed supported connections to a signal, including game-script and engine connections.
Syntax
getconnections(signal: RBXScriptSignal) -> {Connection}
Also available as
get_connectionsget_signal_cons
Parameters
| Parameter | Type | Description |
|---|---|---|
signal | RBXScriptSignal | The event whose connections to list, such as part.Touched. |
Returns
| Type | Description |
|---|---|
{Connection} | One object per connection, in the order the engine runs them. |
Description
Each returned object describes one connection and can control it. See connection:Fire for its fields and methods. The supported forms include Connect, Once, ConnectParallel and waiting :Wait() calls. The result is a snapshot and entries can expire as listeners disconnect or their owning context ends.
Example
local button = game.Players.LocalPlayer.PlayerGui.Menu.Play
for _, connection in getconnections(button.MouseButton1Click) do
print(connection.Function, connection.Enabled, connection.LuaConnection)
connection:Fire()
end
Notes
- A connection made from another Luau state, such as an Actor, has
ForeignState = true, and itsFunctionandThreadarenil. - Engine-side connections have
LuaConnection = false; they cannot be fired or read, but can be disabled.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
