> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getconnections

Returns the connection objects attached to a `signal`, including ones connected by <abbr title="A Luau script not created by Seliware - the engine's own CoreScripts, or game-side LocalScripts.">foreign Luau states</abbr>.

```luau theme={null}
getconnections(signal: RBXScriptSignal): {Connection}
```

Each entry in the returned table is a `Connection` object - one per live `:Connect` call on `signal` at the moment you call. See [`Connection`](/docs/signals/connection) for the object's fields and methods.

Most commonly used to break anti-AFK by disabling every handler on `Player.Idled`.

## Parameters

| Parameter | Type                                                                                           | Description                                |
| --------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `signal`  | [`RBXScriptSignal`](https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptSignal) | The signal whose connections to enumerate. |

## Returns

[`{Connection}`](/docs/signals/connection) - an array of wrappers, one per live `:Connect` call on `signal`. Foreign-state connections are included; their `Function` and `Thread` fields read as `nil` but the methods still work.

## Example

In a Roblox game, `Player.Idled` fires after \~5 minutes of no input - and Roblox kicks you for being AFK for >20 minutes. Disable every connection on the signal so the handler never runs.

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local connections = getconnections(workspace.ChildAdded)
  =======
  -- getconnections(signal: RBXScriptSignal): {Connection}
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local LocalPlayer = game.Players.LocalPlayer

  for _, conn in ipairs(getconnections(LocalPlayer.Idled)) do
      conn:Disable()
  end
  ```
</CodeGroup>

<Tip>
  Always check parameters and return values when working with this library function.
</Tip>
