> ## 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.

# getsignalarguments

Returns the arguments passed to a connection the last time its signal fired.

```luau theme={null}
getsignalarguments(connection: RBXScriptConnection): {any}
```

Takes a `RBXScriptConnection`, not the signal itself. `connection` object can be obtained from `signal:Connect(fn)` or `getconnections(signal)[i]`.

Most commonly used as a cheaper alternative to `hookmetamethod` - inspect what args a listener received instead of intercepting every game method.

## Parameters

| Parameter    | Type                  | Description                |
| ------------ | --------------------- | -------------------------- |
| `connection` | `RBXScriptConnection` | The connection to inspect. |

## Returns

`{any}` - a table of args that were last passed through `connection` when its signal fired.

## Example

In Doors, the server fires `<RemoteEvent> RoomEvent` whenever the player enters a new room. Grab the game's own listener with `getconnections` and read what the server sent the next time it fires.

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local args = getsignalarguments(workspace.ChildAdded)
  =======
  -- getsignalarguments(connection: RBXScriptConnection): {any}
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local remote = game.ReplicatedStorage:WaitForChild("RoomEvent")
  local conn = getconnections(remote.OnClientEvent)[1]

  remote.OnClientEvent:Wait()
  local args = getsignalarguments(conn)
  print(`server room update: {args[1]}`)
  ```
</CodeGroup>

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