Signal. new Synchronous
KawaiiSignal.newPsmSignal.newVoltSignal.new
Create a custom Luau signal for passing events between parts of a script. Use a custom signal to keep a producer, such as a settings editor, independent from the code that reacts to its changes. Save connections so listeners can be removed when their UI closes.
Luau
Signal.new() -> SignalParameters
This function takes no arguments.
Returns
SignalA Signal object with Connect, Once, Wait, Fire, DisconnectAll, and Destroy methods.
Usage notes
Signal, KawaiiSignal, VoltSignal, and PsmSignal refer to the same library.
Example
Luau
local changed = Signal.new()
local connection = changed:Connect(function(value)
print("Changed:", value)
end)
changed:Fire("dark")
connection:Disconnect()
changed:Destroy()