> ## Documentation Index
> Fetch the complete documentation index at: https://zyra-store.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

If your script is not working as expected, do not worry. Most problems have a simple cause and a straightforward solution. In this guide you will find the most common errors when installing or configuring Zyra Store scripts, along with the exact steps to resolve them.

***

## Initial diagnosis

Before looking for a specific error, follow these steps to get clear information about what is failing:

1. **Check the server console.** Open your FiveM server console and look for lines containing `ERROR`, `WARN`, or your resource name. Lua errors usually indicate the exact file and line where the problem occurs.
2. **Enable debug mode.** In your `shared/config.lua`, set `Config.Debug = true`. This enables detailed logs in both the server console and the client console (F8 in-game), making it easier to trace the script's execution flow.
   ```lua shared/config.lua theme={null}
   Config.Debug = true
   ```
3. **Verify the load order.** Make sure all resources the script depends on (such as `es_extended`, `ox_lib`, `oxmysql`) are started **before** the Zyra Store script in your `server.cfg`.

***

## Common problems

> [accordion] The resource does not start
>
> **Symptom:** The resource does not appear as started in the console or shows an error when the server starts.
>
> **Solutions:**
>
> * Verify that the resource folder name matches exactly the name declared in `fxmanifest.lua` (the `name` field). Uppercase and lowercase letters matter.
> * Make sure the line `ensure zyra-mi-script` (or `start zyra-mi-script`) is present in your `server.cfg`.
> * Check that the load order is correct: dependencies must start before the Zyra script.
> * Verify that the resource folder is located inside `resources/` or a correctly referenced subfolder with `ensure` in `server.cfg`.

> [accordion] Error: 'es\_extended' is not started
>
> **Symptom:** The console shows `SCRIPT ERROR: 'es_extended' is not started` when trying to start the resource.
>
> **Solutions:**
>
> * Make sure `es_extended` is started **before** the Zyra script in your `server.cfg`.
> * Verify that `es_extended` has no errors of its own preventing it from starting.
> * If you use QBCore instead of ESX, make sure you have correctly configured the framework in `Config.Framework` inside `shared/config.lua`.

> [accordion] Error: attempt to index a nil value (global 'Config')
>
> **Symptom:** The console shows `attempt to index a nil value (global 'Config')` in some resource file.
>
> **Solutions:**
>
> * The `shared/config.lua` file is not loading. Open `fxmanifest.lua` and verify that `shared/config.lua` is listed in the `shared_scripts` section **before** any other file that uses `Config`.
> * Confirm that the `shared/config.lua` file has no syntax errors preventing it from loading. Check that all tables are properly closed.
> * Also check that the mandatory configuration fields are present: `Config.framework`, `Config.locale`, `Config.permissions`, and `Config.features`.

> [accordion] Notifications do not appear
>
> **Symptom:** Actions execute correctly but the player sees no on-screen notification.
>
> **Solutions:**
>
> * If `Config.UseOxLib = true`, verify that `ox_lib` is started and working correctly.
> * If `Config.UseOxLib = false`, the system will use native FiveM notifications. Make sure no other resource is blocking or overriding `DrawNotification`.
> * Check that the `ox_lib` resource is declared as a dependency in the script's `fxmanifest.lua` and that it loads before it.

> [accordion] ACE permissions are not working
>
> **Symptom:** Players cannot access commands or restricted functions even though they have the assigned group.
>
> **Solutions:**
>
> * Verify the exact syntax in `server.cfg`. The correct format is:
>   ```text theme={null}
>   add_ace group.admin command.script-admin allow
>   add_principal identifier.license:abc123 group.admin
>   ```
> * Check that the group defined in `server.cfg` matches the one configured in `Config.permissions` inside `shared/config.lua`.
> * Use the `list_aces` command in the server console to verify that permissions are registered correctly.
> * Use `list_principals` to confirm that the player is assigned to the correct group.
> * Restart the server or reload the configuration after modifying `server.cfg`.

> [accordion] The /script-admin, /reload-config, or /toggle-feature commands do not respond
>
> **Symptom:** When executing one of the script commands in chat, nothing happens or a permission denied message appears.
>
> **Solutions:**
>
> * Make sure the player has the necessary ACE permissions assigned in `server.cfg` (see the ACE permissions section above).
> * Verify that `Config.permissions` in `shared/config.lua` points to the correct group for each command.
> * Confirm that the resource is active by running `ensure zyra-mi-script` in the server console.
> * For `/reload-config`, make sure `shared/config.lua` contains no syntax errors before reloading.

> [accordion] The database does not connect
>
> **Symptom:** Errors related to MySQL when starting the resource, such as `connection refused` or `unknown database`.
>
> **Solutions:**
>
> * Verify that `oxmysql` is correctly configured in `server.cfg` with the correct connection string:
>   ```text theme={null}
>   set mysql_connection_string "mysql://user:password@host/db_name"
>   ```
> * Confirm that you have imported the `.sql` file included in the resource into your database before starting it.
> * Make sure `oxmysql` is started before the Zyra Store script.
> * Verify that the MySQL user has read and write permissions on the database.

> [accordion] The script works locally but not in production
>
> **Symptom:** Everything works in your development environment but fails on the production server.
>
> **Solutions:**
>
> * Verify that the FiveM **artifact** version in production meets the script's minimum requirements (check the `fxmanifest.lua`).
> * Check the **OneSync** configuration on your server. Some scripts require `onesync on` or `onesync legacy` to work correctly on servers with more than 32 players.
> * Make sure all dependencies (ox\_lib, oxmysql, framework) are on the same version in production as they are locally.

> [accordion] Events do not fire between resources
>
> **Symptom:** An external resource does not receive events emitted by the Zyra script, or vice versa.
>
> **Solutions:**
>
> * Verify that the event names match exactly (case-sensitive). Client events are `zyra:onScriptReady`, `zyra:onPlayerAction`, and `zyra:onResourceStart`; server events are `zyra:onPlayerConnect`, `zyra:onAdminAction`, and `zyra:onDataSync`.
> * Check that the files containing the `AddEventHandler` are declared in `client_scripts` or `server_scripts` inside the `fxmanifest.lua` of the listening resource.
> * Confirm that server-side events are not being attempted to listen to on the client, and vice versa.
> * If the event is from server to client, make sure to use `TriggerClientEvent` with the correct `source`.

> [accordion] Conflict with another resource
>
> **Symptom:** The script fails or behaves unexpectedly only when other resources are active.
>
> **Solutions:**
>
> * Identify the conflicting resource by disabling resources one by one until you find the culprit.
> * Look for duplicate event names or exports between resources. If two resources define the same global event, they can interfere with each other.
> * Rename conflicting events by adding a unique prefix to the event name in the resource you control.
> * Check if any external resource is overriding native FiveM functions that the Zyra script uses.

> [accordion] ox\_lib version error
>
> **Symptom:** Errors related to `lib` functions that do not exist or behave unexpectedly.
>
> **Solutions:**
>
> * Open the Zyra Store script's `fxmanifest.lua` and locate the `dependencies` field. There you will find the minimum required version of `ox_lib`.
> * Download and install the correct version of `ox_lib` from its official repository.
> * Avoid using older versions than required, as they may lack functions the script needs.

***

## Diagnostic commands

You can use the following commands directly in the **server console** to diagnose and manage the resource state:

```text theme={null}
restart zyra-mi-script    # restart the resource without restarting the server
ensure zyra-mi-script     # ensure the resource is running
list_aces                  # list all assigned ACEs
list_principals            # list groups and assigned players
```

In addition, the script itself exposes management commands that you can execute in the game chat with the appropriate permissions:

```text theme={null}
/reload-config            # reloads shared/config.lua without restarting the server
/toggle-feature           # enables or disables a feature in real time
/script-admin             # opens the script administration panel
```

> [!TIP]
>
> Use `/reload-config` after modifying `shared/config.lua` to apply changes without needing to restart the entire server. Changes to `fxmanifest.lua` do require a full server restart.

***

## Get support

If after reviewing this guide you have not been able to resolve the problem, the Zyra Store team is available to help you:

> [card] [Support Discord](https://discord.gg/zyrastore)
>
> Join our Discord server and open a ticket in the technical support channel.

> [card] [Zyra Store website](https://zyrastore.com)
>
> Check additional documentation and the latest updates for all our scripts.

> [!NOTE]
>
> When requesting support, always include the **full server console error** (not just a partial screenshot). Without the complete error message and the affected resource name, we cannot help you efficiently.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.