# Loot Tables

## Loot Tables

### How It Works

When an airdrop spawns, the system picks a loot tier based on weight. Higher weight means higher chance.

| Tier      | Weight | Chance |
| --------- | ------ | ------ |
| Common    | 60     | \~60%  |
| Rare      | 30     | \~30%  |
| Legendary | 10     | \~10%  |

### Table Structure

```
Config.LootTables = {
    ['common'] = {
        label = 'Common',
        color = '#6fa8dc',
        weight = 60,
        minItems = 2,
        maxItems = 4,
        items = {
            { name = 'bread', label = 'Bread', min = 2, max = 5, chance = 80 },
        }
    },
}
```

| Field    | Description                                |
| -------- | ------------------------------------------ |
| label    | Display name in UI                         |
| color    | Hex color for UI elements                  |
| weight   | Selection weight higher equals more common |
| minItems | Minimum items per drop                     |
| maxItems | Maximum items per drop                     |

### Item Structure

```
{ name = 'bread', label = 'Bread', min = 2, max = 5, chance = 80 }
```

| Field  | Description                        |
| ------ | ---------------------------------- |
| name   | Item name in your inventory system |
| label  | Display name in loot popup         |
| min    | Minimum quantity                   |
| max    | Maximum quantity                   |
| chance | Percentage chance to appear 1-100  |

### Adding Weapons

Use the GTA V weapon hash name:

```
{ name = 'WEAPON_PISTOL', label = 'Pistol', min = 1, max = 1, chance = 40 }
{ name = 'WEAPON_SMG', label = 'SMG', min = 1, max = 1, chance = 25 }
```

Weapons are automatically detected and given via the correct framework method.

### Adding Custom Tier

```
['epic'] = {
    label = 'Epic',
    color = '#e74c3c',
    weight = 5,
    minItems = 5,
    maxItems = 8,
    items = {
        { name = 'WEAPON_CARBINERIFLE', label = 'Rifle', min = 1, max = 1, chance = 50 },
    }
}
```

Add it inside Config.LootTables. The UI and system automatically adapts.

### Duplicate Prevention

The system never gives the same item twice in one drop. If an item is already selected, it picks another one.


---

# Agent Instructions: 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:

```
GET https://elena-scripts.gitbook.io/elenascripts/core-systems/airdrop/loot-tables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
