The Connection object

The retrieved connection object will only have the listed methods and fields, since it's a custom 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

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 Functionnor Threadexisting in the current Luau VM.

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

Method Signature
Description

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