Lua-side duplication of the API of events on Roblox objects.

Signals are needed for to ensure that for local events objects are passed by reference rather than by value where possible, as the BindableEvent objects always pass signal arguments by value, meaning tables will be deep copied. Roblox's deep copy method parses to a non-lua table compatable format.

Members

Functions

Returns Functions Description
Signal Signal.new ( ) Constructs a new signal.

Methods

Returns Methods Description
nil Fire ( ... ) Fire the event with the given arguments.
Connection Connect ( function handler ) Connect a new handler to the event.
... Wait ( ) Wait for fire to be called, and return the arguments it was given.
nil Destroy ( ) Disconnects all connected events to the signal.

Functions Descriptions

Signal Signal.new ( )

Constructs a new signal. Signal.new()

Returns

Methods Descriptions

nil Signal:Fire ( ... )

Fire the event with the given arguments. All handlers will be invoked. Handlers follow Roblox signal conventions.

Parameters

  • ...: Variable arguments to pass to handler

Returns

Connection Signal:Connect ( function handler )

Connect a new handler to the event. Returns a connection object that can be disconnected.

Parameters

  • function handler: Function handler called with arguments passed when :Fire(...) is called

Returns

  • Connection: Connection object that can be disconnected

... Signal:Wait ( )

Wait for fire to be called, and return the arguments it was given.

Returns

  • ...: Variable arguments from connection

nil Signal:Destroy ( )

Disconnects all connected events to the signal. Voids the signal as unusable.

Returns