Skip to main content

Events System

HELIX has a built-in event system that lets different parts of your code communicate without tight coupling. Events work across client and server, so a server-side script can fire an event that a client catches (and vice versa).

In Blueprints, you use UE5's native Event Dispatchers and Custom Events — the standard Unreal approach. In Lua, HELIX provides a custom event API (global functions like RegisterServerEvent, TriggerClientEvent, etc.) that wraps native C++/Blueprint functionality into a simple scripting interface. JavaScript event support via HelixJS is currently in development.

Registering Events

Blueprint Registering an Event Dispatcher
Event BeginPlayBind Event to OnPlayerScoredTargetEventOnScoreReceivedPrint StringIn String"Score received!"
C++ equivalent (for reference)
// 1. Add an Event Dispatcher in the My Blueprint panel
// 2. Call the dispatcher to broadcast
// 3. Other Blueprints Bind to the dispatcher to receive

Triggering Events

Blueprint Calling an Event Dispatcher
Event BeginPlayCall OnPlayerScoredPlayer Id"player_42"Points100

For cross-network events, use the scripting layer (Lua/JS).

C++ equivalent (for reference)
// Call your Event Dispatcher to notify all bound listeners.

Built-in Game Events

HELIX fires these events automatically. Subscribe to them to react to core game moments:

EventContextDescription
HEvent:PlayerReadyServerA player has loaded and is ready
HEvent:PlayerUnloadedServerA player disconnects
HEvent:CharacterSpawnedServerA character has been spawned
note

The built-in event names and signatures may evolve during the Closed Alpha. Check the reference documentation for the latest list.

Custom Events

Define your own events for game-specific logic. Pick a name and go:

Blueprint Custom Event Dispatcher
StartWaveWave NumberSpawn ZombiesCountCall OnZombieWaveStartedWave NumberZombie Count
C++ equivalent (for reference)
// 1. Add an Event Dispatcher "OnZombieWaveStarted"
// 2. Call it with WaveNumber and ZombieCount parameters
// 3. Other Blueprints bind to it to react

Cross-Package Events

Events are great for cross-package communication. Use local events to communicate between packages on the same side (client-to-client or server-to-server):

-- Package A (server): notify other server packages
TriggerLocalServerEvent("InventoryUpdated", playerId, inventoryData)

-- Package B (server): listen for cross-package events
RegisterServerEvent("InventoryUpdated", function(controller, playerId, data)
-- Update your systems
end)

Lua Event API Summary

These are global functions available in Lua scripts. They wrap HELIX's native C++ event system into a simple scripting interface.

FunctionDirectionDescription
RegisterServerEvent(name, cb)ServerRegister a server event handler
RegisterClientEvent(name, cb)ClientRegister a client event handler
TriggerServerEvent(name, ...)Client → ServerTrigger a server event from the client
TriggerClientEvent(ctrl, name, ...)Server → ClientSend event to a specific client
TriggerLocalServerEvent(name, ...)Server → ServerCross-package server event
TriggerLocalClientEvent(name, ...)Client → ClientCross-package client event
BroadcastEvent(name, ...)Server → All ClientsSend event to all connected clients
tip

When triggering a server event from a client, the triggering player's controller is automatically passed as the first argument to the server handler (similar to FiveM's source). You don't need to send it manually.

The event system serializes arguments automatically across the network. Stick to primitive types (strings, numbers, booleans) and simple tables/objects for the smoothest experience.