Signal:Wait Asynchronous

  • KawaiiSignal:Wait
  • PsmSignal:Wait
  • VoltSignal:Wait

Pause the calling coroutine until the next Fire, then receive that firing’s arguments. This is convenient for a short one-time handoff between script tasks.

Syntax
Luau
Signal:Wait() -> ...any

Parameters

Call this method with a Signal receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.

This function takes no arguments.

Returns

...any

All values passed to Fire, in order.

Usage notes

Call Wait from a coroutine. Destroying the signal clears pending waiters; it does not deliver a final value to them.

Example

Example
Luau
local ready = Signal.new()
task.spawn(function()
    local item, count = ready:Wait()
    print(item, count)
end)
task.wait()
ready:Fire("loaded", 3)
ready:Destroy()
Kawaii documentation