---
description: Check the instructions below.
---

# Configuration

The script provides a detailed `config.lua` file for customizing crafting mechanics, table locations, and more.

***

#### General Settings

| Setting           | Description                                                          | Default Value             |
| ----------------- | -------------------------------------------------------------------- | ------------------------- |
| `Framework`       | Specifies the framework (`qb`, `esx`, `oldesx`).                     | `"qb"`                    |
| `MySQL`           | Specifies the MySQL library (`oxmysql`, `ghmattimysql`, or `false`). | `"oxmysql"`               |
| `Tebex`           | Tebex URL for purchases (if applicable).                             | `"https://gfx.tebex.io/"` |
| `BoostPrice`      | Additional cost multiplier for boosting crafting results.            | `100`                     |
| `BoostPercentage` | Percentage boost for crafting success.                               | `0.5` (50%)               |
| `blips`           | Enable or disable blip markers for crafting tables.                  | `false`                   |

***

#### Crafting Tables

Define crafting table locations, requirements, and categories.

| Setting      | Description                                               | Example Value                           |
| ------------ | --------------------------------------------------------- | --------------------------------------- |
| `Coords`     | Coordinates of the crafting table.                        | `vector3(454.3285, -979.7649, 30.6896)` |
| `Job`        | Restrict crafting to specific jobs (`all` or job name).   | `"police"`                              |
| `Grade`      | Minimum job grade required to access the table.           | `2`                                     |
| `Distance`   | Interaction distance from the table.                      | `1.0`                                   |
| `Marker`     | Visual marker settings (type, size, and color).           | (See example below)                     |
| `Blip`       | Optional map marker configuration (sprite, color, label). | (See example below)                     |
| `Categories` | Crafting categories (e.g., weapons, attachments).         | (See example below)                     |

**Example Crafting Table Configuration**

```lua
CraftingTables = {
    ["police"] = {
        Coords = vector3(454.3285, -979.7649, 30.6896),
        Job = "police",
        Grade = 2,
        Distance = 1.0,
        Marker = {
            Type = 2,
            Size = vector3(0.5, 0.5, 0.5),
            Color = { r = 255, g = 255, b = 255, a = 200 }
        },
        Blip = {
            Sprite = 110,
            Color = 3,
            Label = "Police Crafting Table"
        },
        Categories = {
            { categoryCode = "all", categoryLabel = "All" },
            { categoryCode = "weapons", categoryLabel = "Weapons" },
            { categoryCode = "attachments", categoryLabel = "Attachments" }
        },
        Items = {
            {
                itemCategory = "attachments",
                itemCode = "clip_attachment",
                itemLabel = "Clip",
                itemImage = "clip.png",
                itemLevel = 1,
                itemDuration = 20,
                itemPrice = 100,
                itemExp = 15,
                itemDesc = "A simple clip attachment",
                ingredients = {
                    { itemCode = "iron", quantity = 2, label = "Iron", image = "iron.png" }
                }
            }
        }
    }
}
```

***

#### Item Crafting

Each item includes its own requirements for crafting:

| Setting        | Description                                               | Example Value                |
| -------------- | --------------------------------------------------------- | ---------------------------- |
| `itemCode`     | Unique identifier for the item.                           | `"clip_attachment"`          |
| `itemLabel`    | Display name for the item.                                | `"Clip"`                     |
| `itemImage`    | URL or path to the item’s image.                          | `"clip.png"`                 |
| `itemLevel`    | Level required to craft the item.                         | `1`                          |
| `itemDuration` | Time (in seconds) to craft the item.                      | `20`                         |
| `itemPrice`    | Cost of crafting the item.                                | `100`                        |
| `itemExp`      | Experience points awarded for crafting.                   | `15`                         |
| `itemDesc`     | Description of the item.                                  | `"A simple clip attachment"` |
| `ingredients`  | List of required ingredients (code, quantity, and label). | (See example below)          |

**Example Item Configuration**

```lua
Items = {
    {
        itemCategory = "attachments",
        itemCode = "clip_attachment",
        itemLabel = "Clip",
        itemImage = "clip.png",
        itemLevel = 1,
        itemDuration = 20,
        itemPrice = 100,
        itemExp = 15,
        itemDesc = "A simple clip attachment",
        ingredients = {
            { itemCode = "iron", quantity = 2, label = "Iron", image = "iron.png" }
        }
    }
}
```

***

#### Attachment Items

Attachments for weapons can be defined using the `Attachments` table. Each weapon supports specific attachments such as clips, silencers, and scopes.

| Setting    | Description                               | Example Value                            |
| ---------- | ----------------------------------------- | ---------------------------------------- |
| `itemCode` | The weapon code to attach components to.  | `"weapon_pistol"`                        |
| `hash`     | Attachment hash using GTA's `GetHashKey`. | `GetHashKey("COMPONENT_PISTOL_CLIP_02")` |
| `label`    | Name of the attachment.                   | `"Extended Clip"`                        |

**Example Attachment Configuration**

```lua
Attachments = {
    {
        itemCode = "weapon_pistol",
        attachments = {
            ["clip"] = {
                hash = GetHashKey("COMPONENT_PISTOL_CLIP_02"),
                label = "Extended Clip",
            }
        }
    }
}
```

***

#### Levels

The crafting system supports a leveling mechanism. Experience points are required to advance to the next level.

| Level | Experience Required |
| ----- | ------------------- |
| 1     | `0`                 |
| 2     | `50`                |
| 3     | `100`               |
| ...   | ...                 |

***
