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

# connect

> api.utility.connect: Roblox signal with automatic disconnect.

```luau theme={null}
api.utility.connect(signal: RBXScriptSignal, callback: (...any) -> ()): ()
```

Connect to a Roblox signal (like `RunService.Heartbeat`). Automatically disconnects when your script unloads, so you don't have to track the connection.

<ParamField path="signal" type="RBXScriptSignal" required>
  Signal to subscribe to.
</ParamField>

<ParamField path="callback" type="function" required>
  Receives the signal's arguments.
</ParamField>

## Related

[api.onUnload](/api/overview#onunload) · [Cleanup](/cleanup)
