The Connection object
A new Connectionobject represents an active link to a signal's callback. These are returned by getconnections and allow inspection and manipulation over connections / signals.
Fields
Enabled
boolean
Whether the connection is currently active and will respond to events.
ForeignState
boolean
true if the connection was made from a foreign Lua state (e.g CoreScript)
LuaConnection
boolean
true if the connection was created from Luau, not C or foreign code.
Function
(...any) -> (...any)?
The bound function, or nil in foreign or non-Luau contexts.
Thread
thread?
The thread that created the connection, or nil in foreign or non-Luau contexts
Methods
Connection:Fire(...: any): ()
Fires the connected function with the given arguments.
Connection:Defer(...: any): ()
Defers execution using task.defer
Connection:Disconnect(): ()
Disconnects the connection from the signal.
Connections:Disable(): ()
Prevents the connection from receiving events.
Connection:Enable(): ()
Re-enables a previously disabled connection.
Last updated