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 DispatcherScroll to zoom ยท Drag to pan ยท Drag nodes to move
Event BeginPlayBind Event to OnPlayerScoredTargetEventOnScoreReceivedPrint StringIn String"Score received!"

Triggering Eventsโ€‹

Blueprintโ€” Calling an Event DispatcherScroll to zoom ยท Drag to pan ยท Drag nodes to move
Event BeginPlayCall OnPlayerScoredPlayer Id"player_42"Points100

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

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 DispatcherScroll to zoom ยท Drag to pan ยท Drag nodes to move
StartWaveWave NumberSpawn ZombiesCountCall OnZombieWaveStartedWave NumberZombie Count

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.

โœจ