Open Asterune
AstScriptConnection

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
Methods1

Properties

Connected

AstScriptConnection.Connected: boolean

Whether 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

Luau
local connection = workspace.ChildAdded:Connect(function(child)
  print(child.Name)
end)
connection:Disconnect()

Used by

ExecutionGroup

AstScriptSignal · Instance