AstScriptConnection
Represents a signal handler connection.
Behavior
AstScriptConnection is returned by a signal’s Connect method. Store the
connection when the handler must be disconnected before its source is destroyed.
Destroying an instance disconnects its own signals. Connections to other,
long-lived signals require separate cleanup.
Summary
Members2
Properties1
Whether the handler is still connected.
Methods1
Disconnect(): ()Disconnects the handler.
Properties
Connected
AstScriptConnection.Connected: booleanWhether the handler is still connected.
Methods
Disconnect
AstScriptConnection:Disconnect(): ()Disconnects the handler. Repeated calls are safe. A callback already running is not interrupted.
Operators
__type
Example
local connection = workspace.ChildAdded:Connect(function(child)
print(child.Name)
end)
connection:Disconnect()