AddEventHandler function from a client-side file in your resource. The event name always follows the pattern zyra:eventName.
other-resource/client.lua
Event reference
zyra:onScriptReady
zyra:onScriptReady
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
zyra:onPlayerReady
zyra:onPlayerReady
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.ParametersExample
The player’s license identifier (for example,
license:a1b2c3d4...). Used to reference the player uniquely within the script.other-resource/client.lua
zyra:onPlayerAction
zyra:onPlayerAction
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.ParametersExample
A table with information specific to the action. The content varies depending on the
action value.other-resource/client.lua
zyra:onNotification
zyra:onNotification
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.ParametersExample
The notification type. Possible values are:
"success"— operation completed successfully"error"— an error occurred"warning"— warning to the player"info"— general informational message
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
RemoveEventHandler to avoid memory leaks and unexpected behavior.
other-resource/client.lua
zyra:onScriptReady. To guarantee that the script is active before your logic depends on it, subscribe to other events within the zyra:onScriptReady callback.
Related resources
- See the Server Events for the server-side counterpart of these events.
