> For the complete documentation index, see [llms.txt](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/installation.md).

# Installation

## Requirements

* A FiveM server with **ox\_lib** started.
* Optional: **oxmysql**, only if you set `Config.Storage = 'oxmysql'`.
* Optional framework: ESX (`es_extended`), QBCore (`qb-core`) or Qbox (`qbx_core`). Without a framework the editor runs standalone.

## 1. Download

The script is delivered through **Cfx.re Asset Escrow**. After the purchase, log in to [portal.cfx.re](https://portal.cfx.re) with the Cfx.re account used for the purchase and open **Granted Assets**. Download `ghiaccio_weaponeditor` from there.

{% hint style="info" %}
Escrowed resources only run on servers whose license key belongs to the purchasing Cfx.re account.
{% endhint %}

## 2. Copy the resources

1. Copy `ghiaccio_weaponeditor` into `resources/`. **Keep the folder name**: the NUI and the patch path depend on it.
2. Copy **`ghiaccio_weaponeditor_patch`** (the sibling folder in the download) into `resources/` as a separate resource: it holds the `.meta` files the editor generates.

{% hint style="warning" %}
Do not edit the `.meta` files of `ghiaccio_weaponeditor_patch` by hand: their content is written by the editor. The file names are fixed, so a plain `restart` is enough (no `refresh`).
{% endhint %}

## 3. server.cfg

```cfg
ensure ox_lib
# ensure oxmysql                        # only with Config.Storage = 'oxmysql'
# ... your framework (es_extended / qb-core / qbx_core) and every other resource (weapon packs included)
ensure ghiaccio_weaponeditor
ensure ghiaccio_weaponeditor_patch      # AFTER every other WEAPONINFO resource so the patch wins

# REQUIRED: lets the editor write the patch (without it HOT/RESTART values never reach players)
add_filesystem_permission ghiaccio_weaponeditor write ghiaccio_weaponeditor_patch

# permissions (cumulative: admin > hot > edit > use)
add_ace group.admin ghiaccio_weaponeditor.admin allow   # everything: global presets, rollback, rescan
add_ace group.admin ghiaccio_weaponeditor.hot allow     # HOT fields, ammo, attachments
add_ace group.mod   ghiaccio_weaponeditor.edit allow    # LIVE fields
add_ace group.mod   ghiaccio_weaponeditor.use allow     # read-only and preview

# per-player example:  add_ace identifier.license:YOUR_LICENSE ghiaccio_weaponeditor.admin allow

# optional Discord audit webhook (or ServerConfig.Webhook in config_server.lua; never in config.lua)
# set gwe_webhook "https://discord.com/api/webhooks/..."
```

### Ensure order

| Order | Resource                                                           | Why                                                           |
| ----- | ------------------------------------------------------------------ | ------------------------------------------------------------- |
| 1     | `ox_lib`                                                           | Required dependency.                                          |
| 2     | `oxmysql`                                                          | Only with `Config.Storage = 'oxmysql'`.                       |
| 3     | Your framework and every other resource, **weapon packs included** | Running weapon resources are scanned as reference data.       |
| 4     | `ghiaccio_weaponeditor`                                            | The editor.                                                   |
| 5     | `ghiaccio_weaponeditor_patch`                                      | **After** every other WEAPONINFO resource, so its values win. |

{% hint style="danger" %}
The `add_filesystem_permission` line is **mandatory**: without it HOT/RESTART values never reach players. `/wepeditor_selftest` (test S6) prints the exact line if the permission is missing.
{% endhint %}

## 4. Framework detection

With `Config.Framework = 'auto'` (default) the framework is detected in this order: **`qbx_core` > `qb-core` > `es_extended`**, otherwise standalone. The framework is resolved on every call, so detection still works if the framework starts after the editor. Set `Config.Framework` to `'esx'`, `'qbcore'`, `'qbox'` or `'standalone'` to force it.

ACE permissions always work. Framework groups and jobs are optional extras (see [Commands & permissions](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/commands-and-permissions.md)):

{% tabs %}
{% tab title="ESX" %}
Framework groups are read with `xPlayer.getGroup()`.

```lua
Config.Permissions.groups = { admin = 'admin' }
```

{% endtab %}

{% tab title="QBCore" %}
Framework groups are checked with QBCore `HasPermission`.

```lua
Config.Permissions.groups = { god = 'admin', admin = 'admin' }
```

{% endtab %}

{% tab title="Qbox" %}
Groups are checked as ACE groups `group.<name>`.

```lua
Config.Permissions.groups = { admin = 'admin' }
```

{% endtab %}

{% tab title="Standalone" %}
Groups are checked as ACE groups `group.<name>`. The simplest setup is to use only the `add_ace` lines in `server.cfg`.
{% endtab %}
{% endtabs %}

## 5. Configure (optional)

Edit `config.lua` (language `Config.Locale`, command, keybind, framework groups/jobs, storage) and `config_server.lua` (webhook). See [Configuration](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/configuration.md).

## 6. Verify

1. Restart the server and open the editor in game with `/weaponeditor`.
2. Run `/wepeditor_selftest` as an admin and read the PASS/FAIL/INFO report in the **server console**. See [Commands & permissions](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/commands-and-permissions.md).

## Escrow: what you can edit

`client/`, `server/` and `shared/` are encrypted (Cfx.re Asset Escrow). These stay editable: `config.lua`, `config_server.lua`, `locales/`, `bridge/`, `data/`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
