Configuration
Every option in STG Crafting System shared/config.lua, from benches, queue and level system to themes, target, the bench creator and notifications.
All settings live in stg-crafting/shared/config.lua, recipes live in stg-crafting/shared/recipes.lua (see Recipes). Both files stay editable in the escrow version. Restart the resource after a change.
Language
Config.Language = 'en'Available: en, de, fr, es, pt, it, nl, pl, sv, no, fi, ar, he, jp, zh. To change a text, edit the matching file in stg-crafting/locales/. Texts of the crafting screen are in the web table at the bottom of each file.
Theme
Config.Theme = 'blue'Colour of the crafting screen and the admin bench list. Available: blue, red, green, purple, orange, pink, yellow, cyan, white and custom.
To use your own colours, set Config.Theme = 'custom' and edit the colour values in stg-crafting/shared/themes/custom.css. Every value is explained at the top of that file.
Interaction
Config.Target = 'auto'How players open a bench:
| Value | Result |
|---|---|
'auto' or true | Uses ox_target if it is running, otherwise qb-target, otherwise the key press. |
'ox_target' or 'qb-target' | Forces that target resource. If it is not running, the key press is used. |
false | Key press only: players stand within the bench radius and press E. |
With a target resource, players can open a bench from 2.5 metres. The target sits on the bench prop, or on a small box at the bench position when the bench has no prop.
Queue
Config.MaxQueueSize = 5
Config.RefundOnCancel = trueProp
Type
Ingredients are taken when a craft is added to the queue. Crafts run one after another and the finished item goes straight into the player's inventory. The queue is saved to the database, so it keeps running while the screen is closed, after a server restart and while the player is offline. Crafts that finished while the player was offline are handed out when they join again.
Benches
The script ships with two weapon benches. Each entry in Config.Benches is one bench, and its key must be unique:
Config.Benches = {
['bench_weapon_1'] = {
label = Locales[Config.Language]['bench_weapon'],
coords = vector3(717.5297, -973.0, 30.3953),
heading = -90.0,
radius = 1.5,
restriction = { type = false, name = 'police' },
minLevel = 0,
recipes = {
'm4a9_nike',
'ak47_custom',
'pistol_mk2',
-- ...
},
blip = { sprite = 110, color = 1, scale = 0.7, visible = false },
prop = 'prop_tool_bench02',
},
}Prop
Type
Gang restrictions read the gang from QBCore and QBOX. ESX has no gangs, so on ESX a bench with type = 'gang' cannot be used by anyone.
Players outside the job or gang see a notification and the bench does not open. Recipes above the player's level show a padlock and their Craft button stays disabled. The bench minLevel is checked when the player presses Craft.
Adding a bench
You can add a bench here in the config, or in game with the bench creator. To add one in the config:
Stand where the bench should be and copy your coordinates and heading, for example with /coords or your admin menu.
Add a new entry to Config.Benches with a new key, using those values for coords and heading.
List the recipe keys the bench should offer in recipes, then restart the resource.
Level system
Config.LevelSystem = {
enabled = true,
xpPerCraft = 10,
maxLevel = 50,
Ranks = {
{ level = 1, label = 'Novice' },
{ level = 5, label = 'Apprentice' },
{ level = 15, label = 'Journeyman' },
{ level = 30, label = 'Expert' },
{ level = 45, label = 'Master Crafter' },
},
}Prop
Type
Every player starts at level 1. The XP needed to reach the next level grows with each level: 263 XP for level 2, 465 for level 3, 951 for level 5 and 2511 for level 10. With the default 10 XP per craft, that is 27 crafts for level 2 and 238 crafts in total to reach level 5. Raise xpPerCraft to make levelling faster.
Level requirements on benches and recipes still apply when enabled is false, and every player stays at level 1. If you turn the level system off, set minLevel to 0 on every bench and recipe.
Bench creator
Config.Creator = {
command = 'benches',
allowedGroups = { 'god', 'admin', 'superadmin' },
}Prop
Type
/benches lists every bench with its coordinates and recipe count. Benches from the config are marked BUILT-IN and can only be teleported to. Benches made in game are marked CUSTOM and can also be edited and deleted.
To create a bench, click + New, then set:
- Minimum Level
- Restriction Type and Job / Gang Name: leave the name empty for everyone. One name only, use the config for a list.
- Prop Model:
prop_tool_bench02by default. Tick No prop (box zone) to place the bench where you stand without a prop. - Show map blip
- Recipes: at least one.
After Save, a see-through prop follows your camera. Rotate it with the Left and Right arrow keys, press Enter to place it or Esc to cancel. The bench appears for every player at once and is saved in the stg_crafting_benches table, so it stays after a restart.
Give yourself access in server.cfg if your framework does not do it already:
add_principal identifier.license:YOUR_LICENSE group.adminNotifications
Config.CustomNotify = false
Config.Functions.Notify = function(type, message, title)
if Config.CustomNotify then
lib.notify({ type = type, description = message, title = title })
else
TriggerEvent('stg-crafting:internal:notify', type, message, title)
end
end
Config.Functions.ShowHelpNotify = function(message)
lib.showTextUI(message, { position = 'left-center', icon = 'hammer' })
end
Config.Functions.HideHelpNotify = function()
lib.hideTextUI()
end- CustomNotify: set to
trueto run the code inConfig.Functions.Notify, then replace thelib.notifyline with your own notification system. Withfalse, the built-inox_libnotification is used. - Notify: used for messages from the game client, such as a cancelled placement or a missing permission. Craft results, level ups and errors sent by the server always use the built-in
ox_libnotification. - ShowHelpNotify and HideHelpNotify: the "Press [E] to open crafting" prompt shown near a bench when no target resource is active.
Still having trouble?
Open a ticket on our Discord. Our team answers around 15 hours a day.