# Full Configuration Guide

### 1. Debug Configuration

```lua
Config.Debug = false
```

#### Purpose

Controls debug messages printed in the client/server console.

***

### 2. Framework Configuration

```lua
Config.Framework = "auto" -- Options : "esx" or "qb" or "qbox"
```

#### Purpose

Defines which framework the crafting system integrates with for:

* player job detection
* gang detection (if supported)
* inventory / item checks
* giving crafted items

#### Supported Values

* `"auto"` → Automatically detects your framework
* `"esx"` → ESX
* `"qb"` → QB-Core
* `"qbox"` → QBox

#### Important

If this value is wrong, **job restrictions, gang restrictions, and crafting rewards may not work correctly**.

***

### 3. Interaction Mode

```lua
Config.Interaction = "target" -- Options : "target" or 'textui'
```

#### Purpose

Controls how players interact with crafting stations in-game.

#### Options

* `"target"` → Uses a target system (recommended)
* `"textui"` → Uses text UI interaction (Press key style)

#### Notes

Use `"target"` if you want clean interaction zones and better UI experience.

***

### 4. Target System Selection

```lua
Config.TargetSystem = 'ox' -- Options : "ox" or 'qb'
```

#### Purpose

Defines which target export is used when `Config.Interaction = "target"`.

#### Options

* `"ox"` → ox\_target
* `"qb"` → qb-target

#### Important

This must match what your server uses, otherwise crafting stations will **not open**.

***

### 5. Crafting Time Multiplier

```lua
Config.CraftingTimeMultiplier = 1.0
```

#### Purpose

Globally increases or decreases crafting duration for all recipes.

#### Behavior

Final crafting time = `recipe.time * Config.CraftingTimeMultiplier`

#### Examples

* `1.0` → Normal crafting speed
* `0.5` → 2x faster crafting
* `2.0` → 2x slower crafting

***

### 6. Max Level XP

```lua
Config.MaxLevelXP = 5000
```

#### Purpose

Defines the maximum XP value a player can reach.

#### Behavior

* Players will gain XP from crafting until they hit this limit.
* Used for progression systems like levels/unlocks.

#### Notes

This works together with category requirements like `minXP`.

***

### 7. Locale / Language Configuration

```lua
Config.Locale = "en" -- Options : en | de | fr | es | ta
```

#### Purpose

Controls the language shown in the crafting UI.

#### Supported Values

* `"en"` → English
* `"de"` → German
* `"fr"` → French
* `"es"` → Spanish
* `"ta"` → Tamil

#### Notes

If the locale file is missing or incomplete, the UI may fallback to another language or show blank text.

***

## 8. Crafting Stations Configuration

```lua
Config.Stations = {
    { ... },
}
```

#### Purpose

Defines all crafting stations available in the world.

Each station controls:

* where crafting is located
* what recipes/categories it can access
* who is allowed to use it (public / job / gang)
* whether a blip appears on the map

***

### 8.1 Station Fields Explained

#### `type`

```lua
type = "workbench"
```

Unique identifier for the station type.

Used internally to separate stations and logic.

***

#### `label`

```lua
label = "Public Workbench"
```

Name shown in UI / target interaction.

***

#### `model`

```lua
model = "prop_tool_bench02"
```

The object model used for the station.

#### Notes

This is usually used for:

* target attaching
* placing interaction point near the model

***

#### `coords`

```lua
coords = vec4(x, y, z, heading)
```

#### Purpose

Defines station location and direction.

#### Format

* `x, y, z` → position
* `heading` → rotation angle

***

#### `blip`

```lua
blip = { enable = true, sprite = 237, color = 3, scale = 0.8, name = "Crafting" }
```

#### Purpose

Controls map blip display for that station.

#### Fields

* `enable` → `true/false`
* `sprite` → blip icon id
* `color` → blip color id
* `scale` → size of blip
* `name` → text shown on map

#### Example (Hidden Station)

```lua
blip = { enable = false }
```

***

#### `categories`

```lua
categories = { "level1", "level2", "level3" }
```

#### Purpose

Defines which crafting categories can be used at this station.

#### Important

If a recipe belongs to a category **not listed here**, it will **not show** at that station.

***

#### `job` restriction (Optional)

```lua
job = "police"
```

#### Purpose

Restricts station access to only players with the given job.

#### Behavior

Only `police` players can open the station.

***

#### `gang` restriction (Optional)

```lua
gang = { "ballas", "families" }
```

#### Purpose

Restricts station access to only specific gangs.

#### Behavior

Only listed gangs can open the station.

***

### 8.2 Your Stations (Explained)

#### Public Workbench

* Accessible by everyone
* Shows categories: `level1`, `level2`, `level3`
* Visible on map

#### Police Armory Crafting

* Only job: `police`
* Shows category: `police_gear`
* Visible on map

#### Gang Workbench

* Only gangs: `ballas`, `families`
* Shows category: `drugs`
* Hidden on map (`blip.enable = false`)

***

## 9. Categories Configuration

```lua
Config.Categories = {
    ["level1"] = { label = "Basic", icon = "...", minXP = 0 },
}
```

#### Purpose

Defines the categories shown in the crafting UI.

Categories control:

* UI grouping of recipes
* unlock requirements using XP (`minXP`)
* icon display

***

### 9.1 Category Fields Explained

#### `label`

```lua
label = "Basic"
```

Text shown in the UI.

***

#### `icon`

```lua
icon = "fa-solid fa-star"
```

#### Purpose

FontAwesome icon class used in the UI.

#### Notes

Make sure the UI includes FontAwesome (it usually does).

***

#### `minXP`

```lua
minXP = 10
```

#### Purpose

Minimum XP required to unlock that category.

#### Behavior

If player XP is lower than `minXP`, the category may be locked or hidden depending on UI logic.

***

### 9.2 Your Categories (Summary)

| Category Key  | Label        | Min XP | Purpose                 |
| ------------- | ------------ | ------ | ----------------------- |
| `level1`      | Basic        | 0      | Starter crafting        |
| `level2`      | Expert       | 10     | Mid-tier crafting       |
| `level3`      | Master       | 20     | High-tier crafting      |
| `police_gear` | Police Gear  | 0      | Police-only crafting    |
| `drugs`       | Black Market | 500    | Gang / illegal crafting |

***

## 10. Recipes Configuration

```lua
Config.Recipes = {
    ["weapon_pistol"] = { ... }
}
```

#### Purpose

Defines every craftable recipe in the system.

Each recipe controls:

* item name / key
* label shown in UI
* crafting time
* output quantity
* XP reward
* required ingredients
* job/gang restrictions (optional)

***

### 10.1 Recipe Fields Explained

#### Recipe Key

```lua
["weapon_pistol"] = { ... }
```

#### Purpose

This is the **crafted item name** (usually matches inventory item name).

#### Important Warning

Your config includes:

* `weapon_pistol`
* `WEAPON_PISTOL`

These are treated as **different keys**.\
Most frameworks use lowercase item names, so using uppercase may cause:

* crafting failures
* items not being given
* inventory mismatch issues

***

#### `label`

```lua
label = "9mm"
```

Name shown in the crafting UI.

***

#### `category`

```lua
category = "level1"
```

#### Purpose

Assigns the recipe to a category.

#### Important

The category must exist in:

* `Config.Categories`\
  AND be allowed inside the station `categories` list.

***

#### `time`

```lua
time = 5000
```

#### Purpose

Crafting duration in milliseconds.

Example:

* `5000` = 5 seconds

Final time is affected by:\
`Config.CraftingTimeMultiplier`

***

#### `output`

```lua
output = 3
```

#### Purpose

How many items are given after crafting completes.

Example:\
If output is `3`, player receives 3 of that item.

***

#### `xp`

```lua
xp = 25
```

#### Purpose

How much XP is rewarded after crafting.

***

#### `ingredients`

```lua
ingredients = {
    { item = "steel", amount = 2 },
}
```

#### Purpose

Items required to craft.

#### Behavior

Player must have all listed ingredients in required amounts.

***

#### `job` restriction (Optional)

```lua
job = "police"
```

Only players with this job can craft the recipe.

***

#### `gang` restriction (Optional)

```lua
gang = { "ballas", "families" }
```

Only players in these gangs can craft the recipe.

***

## 11. Your Recipes Breakdown

### 11.1 Public Workbench Recipes

#### 1) weapon\_pistol

* Category: `level1`
* Time: 5s
* Output: 3
* XP: 25
* Ingredients: `sandwich x3`

#### 2) lockpick

* Category: `level2`
* Time: 4s
* Output: 2
* XP: 15
* Ingredients: `steel x2`

#### 3) WEAPON\_PISTOL (uppercase)

* Category: `level3`
* Time: 5s
* Output: 3
* XP: 25
* Ingredients: `steel x3`

**Important:** This may not work correctly depending on your inventory item naming rules.

***

### 11.2 Police Armory Recipes

#### 1) weapon\_stungun

* Category: `police_gear`
* Time: 10s
* Output: 1
* XP: 50
* Job restricted: `police`
* Ingredients: `battery x8`

#### 2) weapon\_nightstick

* Category: `police_gear`
* Time: 8s
* Output: 1
* XP: 40
* Job restricted: `police`
* Ingredients: `steel x6`

***

### 11.3 Gang Workbench Recipes

#### 1) WEAPON\_APPISTOL (uppercase)

* Category: `level1`
* Time: 5s
* Output: 3
* XP: 25
* Ingredients: `steel x3`

**Note:** This recipe is in `level1`, but your gang station only allows:

```lua
categories = { "drugs" }
```

So this recipe will **NOT appear** in the gang bench unless you add `"level1"` to that station categories.

***

#### 2) weapon\_switchblade

* Category: `drugs`
* Time: 9s
* Output: 1
* XP: 80
* Gang restricted: `ballas`, `families`
* Ingredients: `steel x7`

This one will correctly show in the gang bench.

***

## 12. Common Setup Warnings (Very Important)

### 12.1 Category Not Showing

If a recipe does not appear, check:

1. Recipe category exists in `Config.Categories`
2. Station includes that category in `stations.categories`

Example fix:

```lua
categories = { "drugs", "level1" }
```

***

### 12.2 Job/Gang Names Must Match Exactly

Restrictions like:

```lua
job = "police"
gang = { "ballas", "families" }
```

Must match your framework values exactly (case-sensitive).

***
