Once
Subscribes for a single fire.
Syntax
:Once(fn: function) -> table
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | function | The function or callback to use. |
Returns
| Type | Description |
|---|---|
table | The returned collection or table. |
Description
Once is part of the Signals library. Signals in the VM share the RBXScriptSignal API and are pumped from the external tick loop.
The callback is registered immediately and remains subscribed until the returned connection is disconnected.
Example
workspace.ChildAdded:Once(function(child)
print("first child:", child.Name)
end)
Notes
- Signals share the RBXScriptSignal API across the VM.