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

# Installation

***

## Dependencies

✅ **Supported Scripts**\
Scripts that are fully tested and officially supported.\
🟢 Compatible and ready to use without any additional changes.

❌ **Unsupported Scripts**\
Scripts that are not tested or officially supported.\
🔴 May require custom edits or additional development to work correctly.

⚠️ **Required Dependency**\
This script is required for this resource to work properly.\
Without this dependency installed, the script will not function.

<table data-search="false"><thead><tr><th align="center">Dependencies</th><th align="center">Support</th></tr></thead><tbody><tr><td align="center"><a href="https://github.com/Qbox-project/qbx_core">Qbox Core</a></td><td align="center">✅</td></tr><tr><td align="center"><a href="https://github.com/qbcore-framework/qb-core">QB-Core</a></td><td align="center">✅</td></tr><tr><td align="center">ESX</td><td align="center">❌</td></tr><tr><td align="center"><a href="https://github.com/overextended/ox_target">ox_target</a></td><td align="center">✅</td></tr><tr><td align="center"><a href="https://github.com/qbcore-framework/qb-target">Qb Target</a></td><td align="center">✅</td></tr><tr><td align="center"><a href="https://github.com/overextended/ox_inventory">ox_inventory</a></td><td align="center">✅</td></tr><tr><td align="center"><a href="https://github.com/qbcore-framework/qb-inventory">Qb inventory</a></td><td align="center">✅</td></tr><tr><td align="center"><a href="https://github.com/overextended/ox_lib">ox_lib</a></td><td align="center">⚠️</td></tr></tbody></table>

***

## Installation

1. **Download the Resource**:
   * Clone or download this repository into your `resources` folder.
   * Ensure the folder name is exactly `Project_07_LootProps` (script will warn and may malfunction if renamed).
2. **Add to Server.cfg**:

* ensure Project07\_LootProps

3. **Start the Server**:

* Restart your server or use `refresh` followed by `ensure Project07_LootProps`.

***

## Configuration

All configurations are in `config.lua`. Edit as needed and restart the resource.

#### Key Settings

* **`Config.Debug`**: Enable (`true`) for admin commands like `/clearloot` (requires admin).
* **`Config.Props`**: Define prop categories with models and loot tables.
* `model`: The prop model name (e.g., `prop_pile_dirt_03`).
* `lootCategories`: Array of categories (e.g., weapons, medical) with items, chances (1-100%), and min/max amounts.
* **`Config.CooldownTime`**: Seconds before prop can be searched again after max attempts (default: 1200s / 20min).
* **`Config.MaxLootAttempts`**: Searches allowed per prop cycle (default: 1).
* **`Config.BulkLoot` / `Config.IndividualLoot`**: Toggle bulk vs. individual item options (default: both true).
* **`Config.ProgressTime`**: Progress bar duration in ms (default: 5000ms).
* **`Config.Notifications`**: Customizable messages for events like no loot or inventory full.

***

### Example Prop Config

```lua
['carwreck'] = {
 model = 'prop_pile_dirt_03',
 lootCategories = {
     {
         category = 'weapons',
         items = {
             {name = 'weapon_pistol', chance = 15, min = 1, max = 1},
             {name = 'ammo-9', chance = 35, min = 5, max = 20}
         }
     }
     -- Add more categories...
 }
}
```

> Add a new entry to Config.Props with your model and loot.> \
> Ensure the model exists in your server's map/objects.> \
> Restart the resource – targets will auto-add.

***

## Usage

### In-Game: Approach a configured prop (e.g., dumpster) and use the eye icon to "Search for Loot".

### Search Process:

* Progress bar with animation.
* If valid, opens a context menu with loot items.
* Select individual items or "Loot All".
* Limits: Props lock after max attempts; cooldown applies globally per prop.

### Commands

* /clearloot (Admin Only, Debug Mode): Clears all prop states server-wide.

### Permissions

* No special permissions needed for players.
* Admin command restricted to admin jobs (configurable in server.lua).
