Open Asterune
AstScriptSignal

AstScriptSignal

Registers event handlers or waits for an event.

Behavior

AstScriptSignal represents an API event. Use Connect to register a handler or Wait to yield until the next event. Use BindableEvent to create a script-triggered event.

Summary

Members4
Methods4

Methods

Connect

AstScriptSignal:Connect(function): AstScriptConnection

Registers a callback and returns an AstScriptConnection. Each event invokes the callback on a separate thread. Callback errors do not disconnect the handler. Repeated calls add separate connections.

ConnectParallel

AstScriptSignal:ConnectParallel(this: function): AstScriptConnection

Registers a handler for the parallel phase and returns an AstScriptConnection. The calling script must belong to a parallel-enabled ExecutionGroup. Follow each member's thread-safety metadata inside the handler; call task.synchronize() before operations that require serial execution.

Once

AstScriptSignal:Once(this: function): AstScriptConnection

Registers a callback for the next event only. The connection is removed before the callback runs, preventing recursive invocation of that connection.

Wait

AstScriptSignal:Wait(…)

Yields the current thread until the signal fires, then returns the signal's event arguments.

Operators

__index · __type

Example

Luau
workspace.ChildAdded:Once(function(child)
  print(child.Name)
end)

Used by

Instance · TagService

AstScriptConnection · Instance · BasePart