Hook → Custom Events
Custom Events
Any key not in the signal catalog is treated as a custom event. Subscribe with Hook() and dispatch with Hook.Fire — same priority and id system as built-in signals.
Hook.Fire()
Hook.Fire(event, ...)
Dispatch a custom event immediately, passing any arguments to all registered handlers in priority order.
-- anywhere in your game
Hook.Fire("round.start", { map = "Forest", duration = 120 })
Hook.Fire("round.end", { winner = "Player1", kills = 7 })
Hook.Fire("shop.purchase", player, itemId, price)
Subscribing to custom events
Exactly the same as built-in signals — use Hook() with a priority and optional id.
-- UI module
Hook("round.start", "normal", function(data)
ShowRoundBanner(data.map)
end)
-- Audio module
Hook("round.start", "low", function(data)
Music:Play("combat")
end)
-- Analytics — always last
Hook("round.start", "last", function(data)
Analytics:Track("round_started", data)
end)
Hook vs Bridge
Hook custom events and Bridge overlap in use case. The key differences:
| Hook | Bridge | |
|---|---|---|
| Priority ordering | ✓ | ✗ |
| Named removal | ✓ via id | ✓ via bind name |
| Once | ✓ | ✓ BindOnce |
| Wait / yield | ✗ | ✓ Wait / WaitUntil |
| Built-in signal mapping | ✓ | ✗ |
| Context | Both | Server-side in practice |
Use Hook when order matters between subscribers. Use Bridge when you need to :Wait() for an event to yield a coroutine.
See also
← Hook · Subscribing | Hook(), Once, Off, Clear · Signal Catalog | all mapped Roblox events · Bridge | wait/yield event bus