> For the complete documentation index, see [llms.txt](https://tru-development.gitbook.io/tru-development-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tru-development.gitbook.io/tru-development-docs/tru-lootcases/installation.md). Agents can also search and read this documentation through its [MCP server](https://tru-development.gitbook.io/tru-development-docs/~gitbook/mcp).

# Installation

Documentation / Tru-LootCases

## Installation

Install Tru-LootCases on a development server first. The following instructions apply to the supplied build.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Framework: QBCore, Qbox, ESX Legacy; standalone option.
* Dependencies: Matching inventory integration.
* Access to `server.cfg` and `config.lua`.

### Installation steps <a href="#installation-steps" id="installation-steps"></a>

1. Extract the resource as `Tru-Lootcases` (remove the archive’s `-main` suffix).
2. Install matching definitions from `install/`: `ox_inventory-items.lua`, `qb-core-items.lua`, `qbox-items.lua` or `esx-items.sql`.
3. Copy case images from `install/cases/` into the inventory image folder (`ox_inventory/web/images/` or `qb-inventory/html/images/`).
4. Start after framework and inventory.

```cfg
ensure Tru-Lootcases
```

### ox\_inventory example <a href="#ox-inventory-example" id="ox-inventory-example"></a>

```lua
['common_case'] = {
  label = 'Common Case',
  weight = 500, stack = true, close = true,
  client = { image = 'common_case.png', event = 'tru-lootcases:client:useCase' }
},
```

Use the complete supplied item file for all cases and rewards.

### Verify your installation <a href="#verify-your-installation" id="verify-your-installation"></a>

After starting the resource, check the server console for missing dependencies or script errors. Give a test player a common case, open it, confirm one case is consumed and the reward is received. Repeat with each case type.

> Use valid inventory item identifiers and test with a nearly full inventory. Keep command testing disabled in production.

Continue to [Configuration](https://tru-development.gitbook.io/tru-development-docs/tru-lootcases/configuration.md).

### Production rollout <a href="#production-rollout" id="production-rollout"></a>

Once the initial test passes, repeat it with a second player where the feature involves shared state. Check the behavior after reconnecting and after a resource restart. Keep a backup of the previous server configuration and avoid deploying during peak player activity.

### Preparing reward items <a href="#preparing-reward-items" id="preparing-reward-items"></a>

Install the matching case item definitions and images, then verify every reward item exists in your inventory. The common case is a useful first test because it contains ordinary items and a cash reward. Test the knife assets separately and confirm the relevant weapon definitions are available before making that case accessible to players.
