> 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/tw-lib/tw-lib.md).

# tw-lib

## Overview

**tw-lib** is the free Tworst library. Every Tworst job from version 3.0 on runs on it: it connects the jobs to your framework, inventory, vehicle keys, fuel and clothing scripts, keeps your job settings in the database so updates never reset them, and gives you one admin menu for the economy of all your Tworst jobs.

{% hint style="success" %}
**tw-lib is free.** It comes with every Tworst job, and you can always download the latest version from [GitHub Releases](https://github.com/Tworst-Shop/tw-lib/releases/latest).
{% endhint %}

***

## Which Scripts Need It

| Script                          | Resource         |
| ------------------------------- | ---------------- |
| Multiplayer Diving Job          | `tw-diving`      |
| Multiplayer Electrician Job     | `tw-electrician` |
| Multiplayer Fashion & Print Job | `tw-fashion`     |
| Multiplayer Garbage Job         | `tw-garbagev2`   |
| Multiplayer Gardener Job        | `tw-gardenerv2`  |
| Multiplayer Plumber Job         | `tw-plumber`     |
| Multiplayer Scrapyard Job       | `tw-scrapyard`   |
| Multiplayer Transport Job       | `tw-transportv2` |

All of them need **tw-lib 1.0.0 or newer** from their version 3.0.0 on. The Builder Job, the Lite Jobs Pack and the Admin Menu do not use tw-lib.

***

## What It Does

* **Auto-detection** - Finds your framework, inventory, vehicle keys, fuel and clothing scripts on its own; no framework or inventory setting in any job
* **Settings that survive updates** - Every value you change in a job is stored in the database and written back after an update
* **One-time import** - When you update a job from 1.x / 2.x, your old config, coordinates and texts are imported on the first start
* **Admin menu** - `/twlib`: money paid, jobs, live lobbies, players, every payout and the most changed settings, for all Tworst jobs, in 13 languages
* **One interaction choice** - Prompt card, ox\_target, qb-target or automatic, set once for every job
* **Reconnect** - A player who drops from a running job keeps their place in the crew for a time you choose
* **One job at a time** - A player working one Tworst job is offered to leave it before joining another
* **Shared job UI** - The job menu, prompt card and hint cards are the same in every job
* **Update notice** - On start, the console tells you which Tworst scripts have an update
* **Own scripts** - Connect an unsupported inventory, keys, fuel or clothing script with one export

***

## Requirements

| Resource    | Required | Notes                                             |
| ----------- | -------- | ------------------------------------------------- |
| **oxmysql** | ✅ Yes    | Database                                          |
| Framework   | Optional | QBCore, QBox, ESX, TMC, vRP, or none (standalone) |

***

## Supported Systems

tw-lib finds what runs on your server and prints it on start:

```
[tw-lib] 1.0.0 | framework=qb | inventory=ox_inventory | keys=qs-vehiclekeys | fuel=LegacyFuel | clothing=illenium-appearance
```

| System       | Supported                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Framework    | qbx\_core, qb-core, es\_extended, TMC, vRP, standalone                                                                                                                                                                                                                                                                                                                                          |
| Inventory    | ox\_inventory, qs-inventory, qs-inventory-pro, codem-inventory, codem-inventoryv2, tgiann-inventory, origen\_inventory, ak47\_qb\_inventory, ak47\_inventory, core\_inventory, jaksam\_inventory, one\_inventory, and the framework's own inventory (qb-inventory, ps-inventory, ESX)                                                                                                           |
| Vehicle keys | qbx\_vehiclekeys, qb-vehiclekeys, qs-vehiclekeys, wasabi\_carlock, MrNewbVehicleKeys, jc\_vehiclekeys, Renewed-Vehiclekeys, Jaksam vehicles\_keys, tgiann-hotwire, 0r-vehiclekeys, LifeSaver\_KeySystem, ak47 keys, filo\_vehiclekey, ic3d\_vehiclekeys, is\_vehiclekeys, mk\_vehiclekeys, mm\_carkeys, p\_carkeys, rd\_vehiclekeys, t1ger\_keys, mx\_carkeys, cd\_garage, okokGarage, mVehicle |
| Fuel         | LegacyFuel, ox\_fuel, cdn-fuel, ps-fuel, x-fuel, lc\_fuel, qb-fuel, Renewed-Fuel, myFuel, okokGasStation, qs-fuelstations, BigDaddy-Fuel, esx-sna-fuel, lj-fuel, hyon\_gas\_station, nd\_fuel, rcore\_fuel, ti\_fuel                                                                                                                                                                            |
| Clothing     | illenium-appearance, fivem-appearance, qb-clothing, esx\_skin, rcore\_clothing, codem-clothing, codem-appearance, qs-appearance, 4bit\_appearance, qf\_skinmenu, crm-appearance, tgiann-clothing, 0r-clothing                                                                                                                                                                                   |

{% hint style="info" %}
Using something else? Pick it by hand, or connect your own script. See [Configuration → Choosing a Script by Hand](/tw-lib/tw-lib/configuration.md#choosing-a-script-by-hand).
{% endhint %}

***

## Commands

| Command                               | Where          | Description                                                                                                                    |
| ------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `/twlib`                              | In game        | Admin menu (ACE, framework admin or identifier list, see [Installation](/tw-lib/tw-lib/installation.md#admin-menu-permission)) |
| `twlib`                               | Server console | Status line, detected scripts, saved settings per job                                                                          |
| `twlib set <resource> <path> <value>` | Server console | Change a setting                                                                                                               |
| `twlib unset <resource> <path>`       | Server console | Put a setting back to the default                                                                                              |
| `twlib stats`                         | Server console | Money paid and jobs done, today and in the last 7 days                                                                         |

***

## Quick Links

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Installation</strong></td><td>Install, update, troubleshoot</td><td><a href="/tw-lib/tw-lib/installation.md">Installation</a></td></tr><tr><td><strong>Admin Menu</strong></td><td>The /twlib economy menu</td><td><a href="/tw-lib/tw-lib/admin-menu.md">Admin Menu</a></td></tr><tr><td><strong>Configuration</strong></td><td>Settings, console, script choice</td><td><a href="/tw-lib/tw-lib/configuration.md">Configuration</a></td></tr><tr><td><strong>Exports</strong></td><td>For developers</td><td><a href="/tw-lib/tw-lib/exports.md">Exports</a></td></tr><tr><td><strong>Changelog</strong></td><td>Version history</td><td><a href="/tw-lib/tw-lib/changelog.md">Changelog</a></td></tr></tbody></table>
