Configuration
tw-lib has one small file of its own, tw-lib/config.lua: the admin menu's language and who may open it. Everything else, and every setting you change in a Tworst job, is stored in the database table tw_lib_settings.
Config File
The file is tw-lib/config.lua:
Config.Locale = 'en' -- Language of the /twlib menu: en, tr, de, fr, es, pt, ru, nl, sv, hu, ro, ja, ar
Config.Admin = {
ace = 'tw-lib.admin', -- Players with this ACE open /twlib
frameworkAdmins = true, -- QBCore / QBox admins (god, admin) and ESX admins (admin, superadmin) open /twlib too
identifiers = '', -- Anyone else, comma separated
}Config.Locale
Language of the /twlib menu. 13 languages: English, Turkish, German, French, Spanish, Portuguese, Russian, Dutch, Swedish, Hungarian, Romanian, Japanese, Arabic
Config.Admin.ace
The ACE that opens /twlib. Grant it in server.cfg: add_ace group.admin tw-lib.admin allow
Config.Admin.frameworkAdmins
true: QBCore / QBox players with god or admin, and ESX players in the admin or superadmin group, open the menu without an ACE. false: only the ACE and the list below
Config.Admin.identifiers
Extra players, comma separated. Any identifier works: license:..., discord:..., fivem:..., steam:..., or a QBCore citizenid
identifiers = 'license:1a2b3c4d5e, discord:123456789012345678, ABC12345',Restart tw-lib after editing the file. These values stay on the server; they are never sent to players.
Like the job configs, this file survives updates: tw-lib stores the values you changed and writes them back into the new config.lua.
How Job Settings Survive Updates
You change a value: in the job's
defaults/file, in/twlib→ Settings, or withtwlib set.tw-lib stores only the values you changed, next to the shipped default.
When you install a new version of the job, tw-lib writes your values back into it. Anything new in the update keeps its new default.
After tw-lib stores a value, the line in the config file shows the shipped default next to it, for example:
That marker is how tw-lib tells your value from ours. Leave it there.
Functions (start/end hooks, notifications, prompts) cannot be stored in the database. Put your own functions in the job's hooks/my-hooks.lua: an update never touches that folder.
Updating from 1.x / 2.x
Copy the new job folder over the old one; do not delete the old one first. On the first start, tw-lib reads the old config/ files and texts once and keeps every value you had changed. The console lists what was imported.
Server Console
Prints the status line (version and detected scripts) and how many saved settings each job has.
Change or reset one setting, then restart that resource to apply it:
For a job's Config setting, a value that does not fit (for example a text where a number is expected) is refused with the reason.
Money paid and jobs done, today and in the last 7 days.
Settings for All Jobs
Interaction
twlib set tw-lib interaction ox-target
drawtext, ox-target, qb-target, auto
Reconnect time
/twlib → Settings → All jobs
Off, 1, 3, 5 or 10 minutes
Menu language
Config.Locale in tw-lib/config.lua
en, tr, de, fr, es, pt, ru, nl, sv, hu, ro, ja, ar
A job whose Config.InteractionHandler is 'default' follows the interaction choice here. A job set to its own value keeps it.
Choosing a Script by Hand
tw-lib detects everything on its own. If it picks the wrong script, or you want to turn a feature off, set it by hand and restart tw-lib:
framework
qbx, qb, esx, tmc, vrp, standalone
inventory
framework = use the framework's own inventory
keys
none = give no keys
fuel
native = set the fuel with the game native
clothing
none = no clothing script
any
auto = detect again
Use twlib unset tw-lib bridge.keys to go back to detection. An unknown name is ignored with a warning and tw-lib detects instead.
Connecting Your Own Script
If your inventory, key, fuel or clothing script is not supported, connect it from your own resource with RegisterBridge. tw-lib uses it as soon as it is registered, and forgets it when your resource stops.
Inventory (server side)
Keys, fuel and clothing (client side)
Update Notice
About 5 seconds after start, tw-lib asks tworst.com for the latest version of itself and of every Tworst script that uses it, and prints the result:
Occasionally a short Tworst announcement box is printed below it, in the menu language when available.
Last updated

