> For the complete documentation index, see [llms.txt](https://docs.tworst.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tworst.com/scripts/scrapyard-job/configuration.md).

# Configuration

Complete configuration reference for the Multiplayer Scrapyard Job.

***

## Configuration Files

The script uses multiple configuration files located in the `config/` folder:

| File             | Purpose                                           |
| ---------------- | ------------------------------------------------- |
| `config.lua`     | Main configuration (framework, settings, rewards) |
| `coordinate.lua` | Location coordinates for all job areas            |
| `GetCore.lua`    | Framework detection (usually don't modify)        |

***

## Basic Settings

### Framework & Core

```lua
-- Framework Selection
-- Options: 'qb', 'oldqb', 'esx', 'oldesx', 'vrp', 'vrp2', 'standalone'
Config.Framework = 'qb'

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

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

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

{% hint style="info" %}
**QBox Users:** QBox is fully compatible. Set `Config.Framework = 'qb'` for QBox servers.
{% endhint %}

***

## Inventory Settings

```lua
-- Inventory System (ignored in standalone mode)
Config.Inventory = "qb_inventory"
-- Options: 'qb_inventory', 'esx_inventory', 'ox_inventory', 'qs_inventory', 'tgiann-inventory'

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

-- Default/Fallback Image
Config.DefaultItemImage = "nui://tw-scrapyard/html/img/gun.png"
```

### Image Path Examples

| Inventory        | Image Path                          |
| ---------------- | ----------------------------------- |
| QBCore Inventory | `"nui://qb-inventory/html/images/"` |
| ox\_inventory    | `"nui://ox_inventory/web/images/"`  |
| qs-inventory     | `"nui://qs-inventory/html/images/"` |

***

## Interaction Settings

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

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

***

## Server & Display Settings

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

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

-- Profile Picture (displayed in UI)
Config.ExampleProfilePicture = "https://r2.fivemanage.com/biv23I9cFWICSObhZsr4C/LogoNEW.png"
```

***

## Job Settings

### Lobby & Players

```lua
-- Maximum Players in Lobby
Config.MaxPlayersInLobby = 4  -- 1-4 players per lobby

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

-- Level Requirement Check
Config.jobLevelCheck = false  -- true = check player levels before starting
```

### Commands

```lua
Config.Command = {
    jobReset = "jobresetscrapyard",      -- Reset current job
    jobLeave = "jobleavescrapyard",      -- Leave lobby
    openTutorial = "openTutorialscrapyard", -- Open tutorial menu
}
```

***

## Clothing System

```lua
-- Enable Job Clothing
Config.ChangeClothesSystem = false  -- true/false

-- Clothing Script
Config.ClothingScript = "qb-clothing"
-- Options: 'qb-clothing', 'illenium-appearance', 'fivem-appearance', 'esx_skin', 'rcore_clothing'
```

### Job Uniforms

Customize the job uniform in `Config.JobClothes`:

```lua
Config.JobClothes = {
    male = {
        { jacket = 97,   texture = 0 },
        { shirt = 59,    texture = 0 },
        { arms = 0,      texture = 0 },
        { legs = 9,      texture = 6 },
        { shoes = 12,    texture = 3 },
        -- ... more clothing items
    },
    female = {
        { jacket = 239,  texture = 8 },
        { shirt = 15,    texture = 0 },
        -- ... more clothing items
    }
}
```

***

## Vehicle Key System

```lua
-- Enable Vehicle Keys
Config.Vehiclekey = true

-- Remove Keys on Job End
Config.Removekeys = true
```

The script **auto-detects** your vehicle key system:

* qb-vehiclekeys
* qbx-vehiclekeys
* qs-vehiclekeys
* wasabi-carlock
* cd\_garage
* Renewed-Vehiclekeys

***

## Debug Settings

```lua
-- Debug Mode (shows console messages)
Config.Debug = false

-- Debug Commands (enables testing commands)
Config.DebugCommands = false
```

{% hint style="warning" %}
**Production Servers:** Always set `Config.Debug = false` and `Config.DebugCommands = false` for better performance!
{% endhint %}

***

## Job Location

Configure the main job NPC location:

```lua
Config.Job = {
    ['coords'] = {
        ['intreactionCoords'] = vector3(1213.85, -1251.17, 36.32),
        ['ped'] = true,
        ['pedCoords'] = vector3(1213.85, -1251.17, 36.32),
        ['pedHeading'] = 87.43,
        ['pedHash'] = 0xC5FEFADE  -- Ped model
    },
    ['job'] = 'all',  -- Job requirement: 'all' = anyone can use
    ['blip'] = {
        show = true,
        blipName = Locales[Config.Locale]['jobName'],
        blipType = 317,
        blipColor = 17,
        blipScale = 0.70
    },
}
```

***

## Region & Rewards

Configure work regions and their rewards:

```lua
['regionData'] = {
    {
        regionID = 1,
        regionInfo = {
            regionName = "El Burro Heights",
            regionJobTask = Locales[Config.Locale]['regionJobTask'],
            regionImage = "region.png",
            regionMinimumLevel = 0  -- Minimum level required
        },
        regionAwards = {
            money = 5000,           -- Base money reward
            xp = 1000,              -- Base XP reward
            onlineJobExtraAwards = 1,  -- Multiplayer bonus multiplier
            bonusExtraMoney = 500,  -- Bonus money for teamwork
            bonusExtraXP = 200,     -- Bonus XP for teamwork
        },
    },
}
```

***

## Daily Missions

Configure daily missions for extra rewards:

```lua
Config.Job['dailyMission'] = {
    {
        name = 'jobtask_one',
        header = Locales[Config.Locale]['jobtask'] .. " 1",
        label = Locales[Config.Locale]['dailyjobone'],
        count = 50,    -- Tasks to complete
        xp = 2500,     -- XP reward
        money = 1000,  -- Money reward
    },
    {
        name = 'jobtask_two',
        header = Locales[Config.Locale]['jobtask'] .. " 2",
        label = Locales[Config.Locale]['dailyjobtwo'],
        count = 10,
        xp = 1000,
        money = 3000
    },
    -- ... more missions
}
```

***

## Crafting Settings

### Weapon Crafting (Illegal)

```lua
-- Enable Illegal Weapon Crafting
Config.Job['craftWeaponEnabled'] = true
```

### Item Crafting (Legal)

```lua
-- Enable Legal Item Crafting
Config.Job['craftLegalEnabled'] = false
```

***

## Sell NPCs

Configure legal and illegal sell NPCs:

```lua
Config.Job['sellNPCs'] = {
    -- Legal NPC (sells normal items: iron, gold_dust)
    ['legal'] = {
        enabled = true,
        coords = vector3(1158.79, -1311.61, 33.75),
        heading = 172.89,
        pedModel = 'a_m_m_business_01',
        drawText = Locales[Config.Locale]['sell_scrap_items'],
        blip = {
            enabled = false,
            sprite = 473,
            color = 2,
            scale = 0.7,
            name = Locales[Config.Locale]['legal_scrap_buyer']
        }
    },

    -- Illegal NPC (black market dealer)
    ['illegal'] = {
        enabled = true,
        coords = vector3(1165.4, -1311.26, 33.87),
        heading = 160.67,
        pedModel = 's_m_y_dealer_01',
        drawText = Locales[Config.Locale]['black_market_dealer'],
        blip = {
            enabled = false,
            sprite = 486,
            color = 1,
            scale = 0.7,
            name = Locales[Config.Locale]['black_market_dealer_blip']
        }
    }
}
```

***

## Door Lock System

Control access to the illegal crafting area:

```lua
Config.Job['illegalDoor'] = {
    enabled = false,                             -- Enable door lock
    doorHash = 1300820402,                       -- Door model hash
    coords = vector3(1163.42, -1251.99, 34.57),  -- Door position
    locked = true,                               -- Initial state
    distance = 2.0,                              -- Interaction distance
    interactionKey = 47,                         -- G key
    authorizedJobs = {},                         -- Empty = everyone
    checkCarryingItem = true,                    -- Block if carrying items
    checkRequiredItem = false,                   -- Require item to open
    requiredItem = 'iron',                       -- Required item
    requiredAmount = 1,                          -- Amount required
}
```

***

## Level System

Configure XP required for each level (up to level 70):

```lua
Config.RequiredXP = {
    [1] = 1000,
    [2] = 1500,
    [3] = 2000,
    [4] = 2500,
    [5] = 3000,
    -- ... up to level 70
    [70] = 45500,
}
```

***

## Reconnection System

Configure player reconnection settings:

```lua
Config.Reconnection = {
    enabled = true,                    -- Enable reconnection
    gracePeriodSeconds = 0,            -- 0 = unlimited until lobby closes
    maxReconnectAttempts = 3,          -- Max reconnection attempts
    resetAttemptsAfterSeconds = 300,   -- Reset after 5 minutes stable
    autoCleanupExpired = true,         -- Auto-remove expired players

    ownerTransfer = {
        enabled = true,                -- Transfer ownership if owner disconnects
        allowRejoinAsMember = true,    -- Owner can rejoin as member
        prioritizeByScore = true,      -- Highest score becomes owner
        minimumLobbyTime = 60,         -- Min time to be eligible for transfer
    },

    notifications = {
        notifyOnDisconnect = true,
        notifyOnReconnect = true,
        notifyAttemptsRemaining = true,
    },
}
```

***

## UI Positions

Customize UI element positions:

```lua
Config.DefaultUIPositions = {
    teamList = { top = '77.22vh', left = '85.94vw' },
    scoreList = { top = '2.64vh', left = '1.61vw' },
    inviteSide = { top = '2.85vh', left = '73.07vw' },
    notificationDiv = { top = '40.48vh', left = '81.54vw' },
    keyInfoSide = { top = '50%', right = '2.0833vw' },
    dumpsterInfo = { top = '1.3542vw', left = '50%' }
}
```

{% hint style="info" %}
Players can also adjust UI positions in-game through the settings menu!
{% endhint %}

***

## Mission Completion Items

Give items to players when they complete missions:

```lua
Config.Job['missioncompletedItems'] = {
    giveItemPlayer = false,  -- Enable item rewards
    itemList = {
        { item = "sandwich", count = math.random(1, 4) },
        { item = "sandwich", count = 1 },
    },
}
```

***

## Custom Functions

### Start Job Function

Run custom code when a player starts a job:

```lua
Config.startJobFunction = function(source, owneridentifier)
    -- Example: Check if player has specific job
    -- local Player = GetPlayer(source)
    -- if Player and Player.job and Player.job.name == "mechanic" then
    --     return true
    -- end
    -- return false

    return true  -- Default: Allow everyone
end
```

### End Job Function

Run custom code when a player completes a job:

```lua
Config.endJobFunction = function(source, owneridentifier, scoreAmount)
    -- Add custom rewards, logging, etc.
end
```

***

## Coordinate Configuration

The `coordinate.lua` file contains all location data:

* Scrap spawn locations
* Vehicle spawn/return points
* Machine positions (press, shredder, furnace)
* Rail system coordinates
* Crafting table positions

{% hint style="warning" %}
**Advanced:** Only modify `coordinate.lua` if you want to change the physical job location. Incorrect coordinates may break the job!
{% endhint %}

***

## Need Help?

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