ReferenceSignals

signal:Once

Subscribes a callback for one delivery of an Apex-owned signal.

Syntax

signal:Once(callback: function) -> Connection

Parameters

ParameterTypeDescription
callbackfunctionOne-shot listener.

Returns

TypeDescription
ConnectionListener connection.

Description

The listener is removed before further deliveries can invoke it again. The returned connection can also be disconnected before the event fires.

Example

local signal = Signal.new()
signal:Once(function(value) print(value) end)
signal:Fire("hello")

These are Game executor contracts. Check build requirements and session lifetimes before using them.