The Connection object
Notes on the Connection object
The retrieved connection object will only have the listed methods and fields, since it's a custom object
A Connection object represents an active link to a signal's callback. These are returned by getconnections and allow inspection and manipulation over connections/signals.
Fields
| Field | Type | Description |
|---|---|---|
Enabled |
boolean |
Whether the connection is currently active and will respond to events. |
ForeignState |
boolean |
true if the connection was made from a foreign Luau state (e.g. CoreScript). |
LuaConnection |
boolean |
true if the connection was created from Luau, not C. |
Function |
(...any) -> (...any)? |
The bound function, or nil if foreign or non-Luau contexts. |
Thread |
thread? |
The thread that created the connection, or nil in foreign or non-Luau contexts. |
Foreign and C-state behavior
If the connection originates from a foreign Lua state or is a C-level connection, Function and Thread will be nil and their ForeignState property will be true. This is due to neither Function or Thread existing on the current Luau VM.
Methods
| Method Signature | Description |
|---|---|
Connection:Fire(...: any): () |
Fires the connected function with given arguments. |
Connection:Defer(...: any): () |
Defers execution using task.defer. |
Connection:Disconnect(): () |
Disconnects the connection from the signal. |
Connection:Disable(): () |
Prevents the connection from receiving events. |
Connection:Enable(): () |
Re-enables a previously disabled connection. |