> 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/fashion-job/configuration.md).

# Configuration

{% hint style="success" %}
**Your settings survive updates.** In 3.0 every value you change is saved by tw-lib in the database (`tw_lib_settings`). When you install an update, tw-lib writes your values back into the new config file. You never have to back up or merge a config again.
{% endhint %}

***

## Three Ways to Change a Setting

| Way                              | Best for                                                                                                                                                                         |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **In game: `/twlib` → Settings** | Pay, XP, money per piece, cooldown, crew size, level rules, reward split, interaction style. Saved values apply when the job restarts: use the **Restart** button in the menu.   |
| **Edit `defaults/config.lua`**   | Everything else. Save the file and restart `tw-fashion`: tw-lib notices your edit and stores it.                                                                                 |
| **Server console: `twlib set`**  | Quick changes without opening a file: `twlib set tw-fashion Config.MaxPlayersInLobby 3`, then `restart tw-fashion`. Undo with `twlib unset tw-fashion Config.MaxPlayersInLobby`. |

{% hint style="info" %}
After tw-lib stores a value, the line in the config file shows the shipped default next to it, for example `Config.MaxPlayersInLobby = 3 --[[twlib:4]]`. That marker is how tw-lib tells your value from ours. Leave it there.
{% endhint %}

***

## Configuration Files

| File                     | What is inside                                                                                                                                      |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `defaults/config.lua`    | General settings, lobby, commands, UI colours, workshop tiers & rewards, delivery points, daily missions, market, machines, tutorial videos, levels |
| `defaults/locales/*.lua` | Texts in 7 languages                                                                                                                                |
| `hooks/*.lua`            | Your own functions (start/end hooks, notifications, closing other UIs)                                                                              |

{% hint style="info" %}
There is no `Config.Framework`, `Config.Inventory` or `Config.SQL` anymore: tw-lib detects them. The old key, fuel and skin functions are gone too; `Config.Vehiclekey`, `Config.Removekeys` and `Config.ChangeClothesSystem` still switch those features off.
{% endhint %}

***

## General

```lua
Config.Locale             = TwLibLocale or 'en' -- Language: en, tr, de, fr, pt, ru, ar
Config.CurrencyUnit       = '$'
Config.ServeName          = "TWORST"            -- Server name, max 10 characters
Config.MoneyType2         = "bank"              -- Reward account: 'bank' or 'cash'
Config.ScriptSound        = true                -- Job sounds on / off
```

### Language

Default is English. To change it, run `twlib set tw-fashion Config.Locale tr` in the server console and restart the job, or change `'en'` in the `Config.Locale` line and restart the job. Both are kept across updates.

***

## Interaction

```lua
Config.InteractionHandler  = 'default' -- 'default' | 'drawtext' | 'ox-target' | 'qb-target' | 'auto'
Config.DrawTextUI          = 'twlib'   -- 'twlib' (Tworst prompt) | '3dtext'
Config.InteractionKeyColor = "~g~"
```

| Value                         | Meaning                                                                                                                          |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `'default'`                   | Use the choice made once for **all** Tworst jobs in `/twlib` → Settings → All jobs (or `twlib set tw-lib interaction ox-target`) |
| `'drawtext'`                  | Tworst prompt with **E**                                                                                                         |
| `'ox-target'` / `'qb-target'` | Target eye                                                                                                                       |
| `'auto'`                      | ox\_target if running, else qb-target, else the Tworst prompt                                                                    |

***

## Lobby & Job

```lua
Config.MaxPlayersInLobby      = 4     -- Crew size, max 4 (the factory has 4 machines, one per player)
Config.LetOwnerSplitRewards   = true  -- The owner sets each member's share of the money reward
Config.jobCoolDownHours       = 0     -- Hours before the same player can work again (0 = none); every crew member counts
Config.jobLevelCheck          = false -- true: every lobby member needs the tier's minimum level
Config.ChangeClothesSystem    = true  -- Job uniform on start; the player's own clothes come back at the end
Config.Vehiclekey             = true  -- Give keys for the van
Config.Removekeys             = true  -- Take them back at the end
Config.maxWaitingClothesCount = 4     -- Most unfolded / unironed pieces that can wait on the table
Config.Debug                  = false
```

{% hint style="warning" %}
The crew size cannot go above 4: the factory has four machines.
{% endhint %}

### Who Can Take the Job

```lua
Config.Fashion = {
    ['job'] = 'all', -- 'all', a job name ('mechanic') or a list ({ 'mechanic', 'police' })
    ...
}
```

The job rule is checked on the server when a lobby is opened **and** when an invite is accepted. On frameworks without jobs (standalone, vRP, TMC) everyone can join.

### Commands

```lua
Config.Command = {
    jobReset     = "jobresetfashion",
    jobLeave     = "jobleavefashion",
    openTutorial = "openTutorial",
}
```

### Interaction Limits

```lua
Config.Disable = {
    onDeath    = true, -- No interactions while dead
    onNuiFocus = true, -- No interactions while a menu is open
    onVehicle  = true, -- No interactions in a vehicle
    onHandCuff = true, -- No interactions while handcuffed
}
```

***

## Job Menu Look

The job menu is the shared Tworst job UI inside tw-lib. Fashion's colours and pictures:

```lua
Config.UI = {
    primary            = '#bdea4d',                  -- Accent: buttons, titles, bars
    primaryHover       = 'rgb(132, 164, 54)',
    primaryTransparent = 'rgba(189, 234, 77, 0.1)',
    background         = 'rgba(24, 30, 16, 0.94)',
    titleBg            = 'rgba(32, 39, 22, 1)',
    titleFont          = 'Nature',
    logo               = 'img/newLogo.png',          -- Path inside html/ or an https:// link
    scoreIcon          = 'img/teamScoreImg.png',
    regionImage        = 'img/region.png',
    scriptName         = 'Fashion',
}
```

`Config.DefaultUIPositions` sets where the crew list, score, invite and notification boxes sit on screen. Players can also move them in game.

***

## Job Location, Market & Blips

```lua
Config.Fashion = {
    ['coords'] = {
        ['intreactionCoords'] = vector3(722.07, -976.57, 24.13),
        ['ped'] = true,
        ['pedCoords'] = vector3(722.07, -976.57, 24.13),
        ['pedHeading'] = 176.8,
        ['pedHash'] = 0x20C8012F,
    },
    ['market'] = {                         -- The material market NPC
        ['intreactionCoords'] = vector3(452.32, -787.34, 27.36),
        ['ped'] = true,
        ['pedCoords'] = vector3(452.32, -787.34, 27.36),
        ['pedHeading'] = 278.22,
        ['pedHash'] = 0xECD04FE9,
    },
    ['blip'] = { ... },
    ['marketBlip'] = { ... },
    ...
}
```

`['missionBlips']` holds the blips of the box delivery, the van and the delivery point.

***

## Workshop Tiers & Rewards

All four tiers work in the same factory; a higher tier pays more and needs a higher level.

```lua
['regionData'] = {
    {
        regionID = 1,
        regionInfo = {
            regionName = "Starter Workshop",
            regionImage = "region.png",
            regionMinimumLevel = 0,
        },
        regionJobVehicle = { vehicle = "burrito4" },
        regionAwards = {
            money = 5000,               -- Paid to the crew at the end
            xp = 1000,
            onlineJobExtraAwards = 2,   -- Multiplier per extra crew member
            extraMoneyperClothes = 100, -- Extra money for every finished piece (0 = off)
        },
        missioncompletedItems = { giveItemPlayer = false, dropMode = "weightedPool", itemList = { ... } },
        regionJobTask = {
            { jobName = "tshirtcraft",  missionCount = { minAmount = 1, maxAmount = 3, maxTotalAmount = 10 },
              materialsNeeded = { { item = "wool", count = 2 }, { item = "dye", count = 3 } } },
            { jobName = "sweatercraft", missionCount = { minAmount = 1, maxAmount = 3, maxTotalAmount = 10 },
              materialsNeeded = { { item = "wool", count = 3 }, { item = "dye", count = 4 } } },
            { jobName = "boxloading" },
            { jobName = "boxdelivery" },
        },
        regionBoxDeliveryCount = math.random(2, 3),  -- How many drop points a run has
        regionBoxDelivery = { ... },                  -- Drop points (poor / mid / rich)
    },
},
```

| Tier | Name             | Min. level | Money   | XP    | Per piece |
| ---- | ---------------- | ---------- | ------- | ----- | --------- |
| 1    | Starter Workshop | 0          | $5,000  | 1,000 | $100      |
| 2    | Street Boutique  | 3          | $10,000 | 2,000 | $200      |
| 3    | City Atelier     | 5          | $15,000 | 3,000 | $300      |
| 4    | Couture House    | 8          | $20,000 | 4,000 | $400      |

`jobColor` in each craft task switches the five colours on or off. `"dye"` in `materialsNeeded` means the dye of the ordered colour.

{% hint style="info" %}
Your changes to a tier are saved against its `regionID`. If a later update adds, moves or reorders tiers, your money and XP stay with the right tier. Keep `regionID` values unique and do not reuse them.
{% endhint %}

### Reward Split

With `Config.LetOwnerSplitRewards = true` the lobby owner sets each member's share in the lobby menu: the crew's total (the reward per player × the members online at the payout) is shared by those percentages. With `false` every member gets the same reward.

### Mission Completion Items

`missioncompletedItems` gives extra items at the end of a tier. `dropMode = "perItem"` rolls each item on its own; `"weightedPool"` gives one item from the pool. A `chance` of 100 is always given.

***

## Daily Missions

```lua
['dailyMission'] = {
    { name = 'jobtask_one',   xp = 2500, money = 1000, ... },
    { name = 'jobtask_two',   xp = 1000, money = 3000, ... },
    { name = 'jobtask_three', xp = 2000, money = 3000, ... },
    { name = 'jobtask_four',  xp = 2000, money = 3000, ... },
},
```

{% hint style="info" %}
Changes to a daily mission are saved against its `name`. Keep the names unique.
{% endhint %}

***

## Market

```lua
Config.MarketItems = {
    { item = 'darkbluedye', label = 'Dark Blue Dye', image = 'darkbluedye.png', price = 250, weight = 0.1 },
    { item = 'purpledye',   label = 'Purple Dye',    image = 'purpledye.png',   price = 250, weight = 0.1 },
    { item = 'blackdye',    label = 'Black Dye',     image = 'blackdye.png',    price = 250, weight = 0.1 },
    { item = 'whitedye',    label = 'White Dye',     image = 'whitedye.png',    price = 250, weight = 0.1 },
    { item = 'bluedye',     label = 'Blue Dye',      image = 'bluedye.png',     price = 250, weight = 0.1 },
    { item = 'wool',        label = 'Wool',          image = 'wool.png',        price = 150, weight = 0.1 },
}
```

A purchase that does not fit in the player's inventory gives the money back.

`Config.InventoryAccess.allowedItems` lists the materials the job reads from the player's inventory for production. Add an item here if you add it to a recipe.

***

## Machines & Factory

`Config.MachineCoords` holds the four machines and their tables, and `Config.Clothes` the clothing props of the factory map. Leave both as they are unless you move the factory: they match the props in the stream folder.

***

## Tutorial

```lua
Config.TutorialList = {
    { id = 1, title = ..., description = ..., name = 'https://r2.fivemanage.com/.../tutorial_one.mp4' },
    -- ... 6 videos
}
```

Players open it with `/openTutorial`. Replace a `name` with your own video link to show your own tutorial.

***

## Levels

`Config.RequiredXP` holds the XP needed for each of the 70 levels. XP above the requirement carries over to the next level.

***

## Texts

All texts are in `defaults/locales/<language>.lua`. Edit the file and restart the job: tw-lib keeps your edited texts across updates like any other setting. A text missing in a language falls back to English.

***

## Hooks

Functions cannot be stored in the database, so they live in `hooks/`. Copy `hooks/hooks.example.lua` to `hooks/my-hooks.lua` and edit it there. An update replaces only the example; your file is never touched, and it is loaded after the settings, so it wins.

```lua
-- Runs for every player in the lobby before the job starts. Return false to stop that player.
Config.startJobFunction = function(source, owneridentifier)
    local job = exports['tw-lib']:GetPlayerJob(source) -- { name, label, grade }; nil on standalone / vRP / TMC
    return job ~= nil and job.name == 'mechanic'
end

-- Runs for every player when the job is finished.
Config.endJobFunction = function(source, owneridentifier, scoreAmount)
end

-- Your own notification system. type is 'error', 'success' or 'info'.
Config.sendNotification = function(message, type)
    exports['my-notify']:Send(message, type)
end

-- Close your inventory / phone while the fashion menus are open (bool = true when a menu opens).
Config.OtherNuiClose = function(bool)
end
```

{% hint style="info" %}
The shipped `Config.OtherNuiClose` already closes ox\_inventory and lb-phone when a fashion menu opens. Override it only if you use something else.
{% endhint %}

***

## Need Help?

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