Skip to main content
Client events are messages that Zyra Store scripts emit in the client environment (the game running on the player’s machine). You can listen to them from any other FiveM resource to react to what happens inside the script, such as when the player loads their data, opens a menu, or performs a tracked action. To subscribe to any Zyra Store client event, use FiveM’s native AddEventHandler function from a client-side file in your resource. The event name always follows the pattern zyra:eventName.
other-resource/client.lua
These events can only be listened to from client scripts. Attempting to register an AddEventHandler for these events in a server file will have no effect and may generate unexpected behavior in your resource.

Event reference

Fires when the Zyra Store script has completed its initialization fully and is ready to operate. Use it to defer any logic that depends on the script being active.ParametersThis event receives no parameters.Example
other-resource/client.lua
Fires when the local player’s data has been correctly loaded by the script. From this moment on you can assume that the player information is available.Parameters
string
required
The player’s license identifier (for example, license:a1b2c3d4...). Used to reference the player uniquely within the script.
Example
other-resource/client.lua
Fires every time the player performs an action that the script tracks internally. You can use this event to react to specific actions in real time.Parameters
string
required
The name of the performed action, for example "purchase", "interact", or "use_item".
table
required
A table with information specific to the action. The content varies depending on the action value.
Example
other-resource/client.lua
Fires when the player opens the script’s main menu. You can use this event to pause your resource’s logic while the menu is active.Parameters
string
required
The unique identifier of the menu that was opened (for example, "main", "shop", "settings").
Example
other-resource/client.lua
Fires when any script menu is closed by the player. Use it to restore your resource’s state when exiting the menu.Parameters
string
required
The unique identifier of the menu that was closed. Matches the menuId received in zyra:onMenuOpen.
Example
other-resource/client.lua
Fires just before the script shows a notification to the player. You can intercept this event to replace the script’s notification system with your own resource’s.Parameters
string
required
The notification type. Possible values are:
  • "success" — operation completed successfully
  • "error" — an error occurred
  • "warning" — warning to the player
  • "info" — general informational message
string
required
The message text that would be shown to the player.
Example
other-resource/client.lua

Best practices

When working with Zyra Store client events, keep the following recommendations in mind: Do not modify received data directly. The parameters you receive in callbacks are references to the script’s internal data. Only modify local copies if you need to transform the information.
other-resource/client.lua
Clean up your event handlers when you no longer need them. If your resource registers listeners dynamically, use RemoveEventHandler to avoid memory leaks and unexpected behavior.
other-resource/client.lua
Register your listeners after zyra:onScriptReady. To guarantee that the script is active before your logic depends on it, subscribe to other events within the zyra:onScriptReady callback.
  • See the Server Events for the server-side counterpart of these events.