> For the complete documentation index, see [llms.txt](https://fivecore.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fivecore.gitbook.io/home/resources/looting/setup.md).

# Setup

## Setup client config

{% hint style="info" %}
**config\_client.lua**
{% endhint %}

First, we need to configure the **ImagesPath** option. This is essential for the system to locate the correct path to load the item's image in the interface.\
\
If you are using `ox_inventory`, set the `ImagesPath` to:

`ImagesPath = 'nui://ox_inventory/web/images/'`

If you are using `qb-inventory`, set the `ImagesPath` to:

`ImagesPath = 'nui://qb-inventory/html/images/'`

If you are not using either of these or if the path is a web link, you should enter the link without the `.png` extension. For example:

Original link: `https://r2.fivemanage.com/ryfJZiNwBGGSsHzTvTa2B/bandage.png`

You should set it as:

`ImagesPath = 'https://r2.fivemanage.com/ryfJZiNwBGGSsHzTvTa2B/'`

## Setup available items for loot

{% hint style="info" %}
**config\_server.lua**
{% endhint %}

First, we need to create the item categories with all the available items that will be used later. For example, if you are setting up a medical items category with three medical items and a ammo category with some ammo, it would look like this:

```lua
Categories = {
    ['medical'] = { -- Category name
        ['painkiller'] = { -- Item name
            chance = 60, -- Chance of appearing in the loot point (1 to 100 in %)
            min = 1, max = 3, -- Minimum and maximum quantity of the item (if not defined, it will be 1)
            metadata = {durability = 50} -- Metadata to be added to the item (if not defined, it will be nil)
        },
        ['bandage'] = {
            chance = 50,
        },
        ['firstaidkit'] = {
            chance = 20,
        }
    },
    ['ammo'] = {
        ['ammo-22'] = {
            chance = 30,
            min = 6, max = 20
        },
        ['ammo-38'] = {
            chance = 20,
            min = 7, max = 15
        },
        ['ammo-44'] = {
            chance = 20,
            min = 5, max = 15
        }
    },
}
```

Next, we need to define which categories will be available for each object. For example, for a broken car model (prop\_rub\_carwreck\_2), we want players to be able to find medical items and ammunition. The configuration would look like this::

```lua
Props = {
    ["prop_rub_carwreck_2"] = { -- Model name
        label = "Destroyed Vehicle", -- Name that will appear in the interface
        categories = {'medical', 'ammo'}, -- Categories that this loot spot will have
        -- excludeDefault = true -- If you want to exclude the default loot spots for this model set to true
    },
}
```

Whenever a player encounters this object and it is available for looting, the player will have the opportunity to find all the items defined within the specified categories.\
The items will be distributed according to the defined quantities and probabilities. For example, if the prop\_rub\_carwreck\_2 is set to provide items from the "medical" and "ammo" categories:\
The player may find various medical items such as bandages and first aid kits, as defined within the "medical" category.\
Similarly, the player may find ammunition items, as defined within the "ammo" category.\
The actual items and their quantities will be determined based on the configuration for each category and the chance assigned.

## Extra settings

Now that the essential configurations are complete, you should proceed to the client and server configuration files (`config_client.lua` and `config_server.lua`) to finalize the remaining settings according to your preferences.

In these files, you will find various settings along with explanations for each one. Adjust the configurations as needed to match your desired setup.

* **`config_client.lua`**: This file contains client-specific settings. Customize it to control how the client-side of the system behaves.
* **`config_server.lua`**: This file contains server-specific settings. Modify it to manage server-side behavior and interactions.

Be sure to review the explanations provided in these files for each configuration option to ensure you set everything correctly according to your requirements.<br>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fivecore.gitbook.io/home/resources/looting/setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
