Registers a function to run every time the signal fires, and returns a connection whose :Disconnect() removes it. Handlers run in connection order with whatever arguments Signal:Fire passed.

Parameters

function
required
The function to run on each fire.

Returns

Connection
A connection with a :Disconnect() method.

Example

Errors

  • once: run a handler only once.
  • fire: trigger the handlers.