ReferenceSignals

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

ParameterTypeDescription
signalRBXScriptSignalThe event whose connections to list, such as part.Touched.

Returns

TypeDescription
{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

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