Skip to content

getconnections

getconnections retrieves a list of Connection objects currently attached to a given RBXScriptSignal.

function getconnections(signal: RBXScriptSignal): {Connection}

Parameters

Parameter Description
signal The signal to inspect for active connections.

Example

Inspecting and invoking a Luau connection
1
2
3
4
5
6
7
8
9
local folder = Instance.new("Folder")
folder.ChildAdded:Connect(function()
    return "Triggered"
end)

local connection = getconnections(folder.ChildAdded)[1] -- First connection in the list
print(connection.Function())     -- Output: Triggered
connection:Fire() -- Same as above, Output: Triggered
print(typeof(connection.Thread)) -- Output: thread

Example 2

Accessing a foreign/C connection
1
2
3
local cconnection = getconnections(game.Players.LocalPlayer.Idled)[1]
print(cconnection.Function)  -- Output: nil
print(cconnection.Thread)    -- Output: nil