Skip to content
Untitled Sandbox - Developer Documentation
docs/api/signals

@usbx/signals

Messages between scripts

local signals = require("@usbx/signals")

signals.define

function

Creates or gets the Signal with the name. The same name with another schema is an error.

signals.define<T>(name: string, schema: Schema<T>) -> Signal<T>
example
local scored: Signal<{ amount: number }> = signals.define("Scored", schema.struct({ amount = schema.number() }))

Use it forletting one script, like your round script, tell another, like your scoreboard, that someone scored.

nameThe Signal's name. Every script that defines it shares it, and an NPC dialogue's Send Signal node with this name fires it.
schemaWhat payloads it accepts. From an NPC dialogue, the fields npc and player get the NPC and the player.
↑ ↓ moveEnter openEsc close