ScriptConnection

ScriptConnection

Overview

Description

ScriptConnection represents a connection between a signal and a function callback in a script. It allows you to manage and disconnect the connection easily when it is no longer needed.

Properties

Connected

boolean

Indicates whether the connection is currently active. A value of true means the connection is active, while false indicates that the connection has been disconnected.

Code Samples

-- Check if a connection is active
if connection.Connected then
    print("The connection is active.")
else
    print("The connection has been disconnected.")
end

Constructors

No specific constructors are available for this object. This object is usually obtained as a result of connecting a function to a signal.

Methods

Disconnect

Disconnects the connection between the signal and the function. Once disconnected, this connection cannot be reactivated.

Parameters

Return

void

Does not return a value.

Code Samples

-- Example of disconnecting a connection
connection:Disconnect()
if not connection.Connected then
    print("Connection has been successfully disconnected.")
end

Last updated