# Configuration Basics

Learn how to configure Tworst Scripts for your server.

## Config File Structure

All Tworst Scripts use a `config/config.lua` file for configuration. Here's the basic structure:

```lua
Config = {}

-- Framework Selection
-- 'standalone' = No framework required, money system only (no inventory script needed)
-- Other options: esx, oldesx, qb, oldqb, vrp, vrp2
Config.Framework = 'qb'

-- Language
Config.Locale = 'en'  -- Available: 'en', 'tr', 'de', 'fr', 'pt', 'ru', 'ar'

-- Currency Display
Config.CurrencyUnit = '$'  -- Options: '$', '€', '₺'

-- Database Resource
Config.SQL = "oxmysql"  -- Options: 'oxmysql', 'mysql-async', 'ghmattimysql'

-- Inventory System (only for framework modes)
Config.Inventory = "qb_inventory"  -- Options: 'qb_inventory', 'esx_inventory', 'ox_inventory', 'qs_inventory', 'tgiann-inventory', 'codem-inventory'

-- Interaction System
Config.InteractionHandler = 'drawtext'  -- Options: 'drawtext', 'ox-target', 'qb-target'

-- Debug Mode
Config.Debug = false  -- Set to true for development
```

***

## Framework Settings

### Selecting Your Framework

```lua
-- QBCore
Config.Framework = 'qb'

-- QBCore (older versions)
Config.Framework = 'oldqb'

-- QBox (uses 'qb' config value)
Config.Framework = 'qb'

-- ESX Legacy
Config.Framework = 'esx'

-- ESX (older versions)
Config.Framework = 'oldesx'

-- vRP
Config.Framework = 'vrp'

-- vRP2
Config.Framework = 'vrp2'

-- Standalone (no framework required)
Config.Framework = 'standalone'
```

{% hint style="info" %}
**QBox Users:** QBox is fully compatible with our scripts. Simply set `Config.Framework = 'qb'` to use QBox.
{% endhint %}

{% hint style="info" %}
**Standalone Mode:** In standalone mode, there is no inventory system. Rewards are handled through the money system only.
{% endhint %}

***

## Inventory Settings

```lua
-- Inventory System
Config.Inventory = "qb_inventory"

-- Inventory Image Path (change based on your inventory system)
Config.InventoryImagePath = "nui://qb-inventory/html/images/"

-- Default/fallback image when item image not found
Config.DefaultItemImage = "nui://tw-scriptname/html/img/default.png"
```

### Supported Inventory Systems

| System           | Config Value         |
| ---------------- | -------------------- |
| QBCore Inventory | `'qb_inventory'`     |
| ESX Inventory    | `'esx_inventory'`    |
| ox\_inventory    | `'ox_inventory'`     |
| qs-inventory     | `'qs_inventory'`     |
| tgiann-inventory | `'tgiann-inventory'` |
| codem-inventory  | `'codem-inventory'`  |

{% hint style="warning" %}
Inventory systems only work with framework modes (not standalone).
{% endhint %}

***

## Interaction Settings

```lua
-- Interaction Handler
Config.InteractionHandler = 'drawtext'  -- Options: 'drawtext', 'ox-target', 'qb-target'
```

| System     | Config Value  | Description                           |
| ---------- | ------------- | ------------------------------------- |
| DrawText   | `'drawtext'`  | Built-in text prompts (no dependency) |
| qb-target  | `'qb-target'` | QBCore target system                  |
| ox\_target | `'ox-target'` | Overextended target system            |

***

## Clothing System

If your script supports job clothing:

```lua
Config.ChangeClothesSystem = true  -- Enable/disable job clothing
Config.ClothingScript = "qb-clothing"
```

### Supported Clothing Scripts

| System              | Config Value            |
| ------------------- | ----------------------- |
| qb-clothing         | `'qb-clothing'`         |
| illenium-appearance | `'illenium-appearance'` |
| fivem-appearance    | `'fivem-appearance'`    |
| esx\_skin           | `'esx_skin'`            |
| rcore\_clothing     | `'rcore_clothing'`      |

***

## Vehicle Key System

For scripts that use vehicles:

```lua
Config.Vehiclekey = true  -- Enable/disable vehicle key system
```

The script automatically detects your vehicle key system. Supported systems:

| System              | Auto-detected |
| ------------------- | ------------- |
| qb-vehiclekeys      | ✅             |
| qbx-vehiclekeys     | ✅             |
| qs-vehiclekeys      | ✅             |
| wasabi-carlock      | ✅             |
| cd\_garage          | ✅             |
| Renewed-Vehiclekeys | ✅             |

***

## Fuel System

For scripts that spawn vehicles:

```lua
-- The script automatically detects your fuel system
-- Supported: LegacyFuel, x-fuel, ox_fuel, cdn-fuel, ps-fuel
```

***

## Job Settings

Common job-related settings:

```lua
-- Server Name (displayed in UI)
Config.ServerName = "TWORST"  -- Max 10 characters

-- Money Settings
Config.MoneyType = "$"      -- Currency symbol
Config.MoneyType2 = "bank"  -- Payment type: 'bank' or 'cash'

-- Job Cooldown
Config.jobCoolDownHours = 0  -- Hours between jobs (0 = no cooldown)

-- Max Players in Lobby
Config.MaxPlayersInLobby = 4

-- Job Level System
Config.jobLevelCheck = false  -- Enable/disable level requirements
```

***

## Debug Settings

```lua
-- Enable debug mode for development
Config.Debug = false

-- Enable debug commands (for testing)
Config.DebugCommands = false
```

{% hint style="warning" %}
Always set `Config.Debug = false` on production servers for better performance.
{% endhint %}

***

## Commands

Most scripts include configurable commands:

```lua
Config.Command = {
    jobReset = "jobreset",        -- Reset job progress
    jobLeave = "jobleave",        -- Leave current job
    openTutorial = "opentutorial" -- Open tutorial menu
}
```

***

## UI Positions

Some scripts allow you to customize UI element positions:

```lua
Config.DefaultUIPositions = {
    teamList = { top = '77.22vh', left = '85.94vw' },
    scoreList = { top = '2.64vh', left = '1.61vw' },
    notificationDiv = { top = '40.48vh', left = '81.54vw' },
}
```

***

## Best Practices

1. **Always backup** your config before making changes
2. **Test changes** on a development server first
3. **Read comments** in the config file for guidance
4. **Check console** for errors after changes
5. **Use correct config values** - refer to the tables above

{% hint style="warning" %}
After modifying `config.lua`, restart the resource with `ensure [script-name]` or restart the server.
{% endhint %}

***

## Need Help?

{% hint style="info" %}
Having configuration issues? Join our [Discord server](https://discord.gg/tworst) and open a support ticket.
{% endhint %}


---

# 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://docs.tworst.com/guides/configuration-basics.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.
