AcediaDocumentation
Guides

Signals and connections

Tell executor-owned signals apart from engine event connections.

Acedia's Signal.new makes an executor-owned signal with Connect, Once, Fire, and Wait.

Publish your own event

local changed = Signal.new()
local connection = changed:Connect(function(value)
    print("Changed to", value)
end)

changed:Fire(42)
connection:Disconnect()

Once disconnects after its first fire. Wait yields until the signal fires and returns its arguments. The native fire path carries at most 16 argument values. A callback error is isolated by a protected call, so it does not stop other handlers from being invoked.

Inspect an engine signal

Roblox events use RBXScriptSignal instead. getconnections inspects an engine signal and returns records with fields such as Enabled, LuaConnection, Function, and Thread. Those records can fire, defer, disable, or disconnect the live node, but they are not the same objects returned by Signal.new():Connect.

Keep the actual connection handle whenever possible. An inspection record can become stale after the underlying node disconnects, and retaining the record does not keep that node alive.

On this page