FiveM crafting: ox_inventory bench or a script
If your ESX or Qbox server runs ox_inventory, its free crafting benches cover fixed recipes at fixed places, and you may not need a crafting script at all. A script such as our Crafting adds recipes locked behind blueprints or crafting XP, plus tables players place themselves. It also runs on QBCore with qb-inventory.
What to compare
Three things decide it: which inventory you run, whether recipes should unlock over time, and who decides where the tables go.
| Question | ox_inventory benches | Our Crafting |
|---|---|---|
| Frameworks | ESX, Qbox, ox_core and ND Core, with ox_inventory | ESX, Qbox and QBCore, with ox_inventory or qb-inventory |
| Where recipes live | data/crafting in ox_inventory |
sv_config in the script |
| Who can use a table | Jobs and minimum grades per bench | Jobs and minimum grades per table |
| Locked recipes | None built in | Blueprints and crafting XP, per recipe |
| Tables players place | None built in | Items that place a table, saved over restarts |
| Ingredients that aren’t used up | Set the amount to 0 |
Set keep = true |
| Cost | Free, open source under GPL-3.0 | Paid, sold on its own or in a plan |
ox_inventory crafting benches
This suits a server on ox_inventory that wants a handful of benches with set recipes, such as a gun bench for one gang or a workshop for mechanics.
You define every bench in ox_inventory’s data/crafting (docs). A bench has its recipes in items, the places players open it in points, or in zones if you use ox_target, and the jobs allowed in groups, each with a minimum grade. It can show a blip on the map.
Each recipe lists its ingredients, a duration in milliseconds and a count. The count can be a fixed number or a random range, and the crafted item can carry metadata. An ingredient set to 1 or more is how many get used up. Set it to 0 and the player needs it but keeps it. A value between 0 and 1 takes that much durability instead.
The limits are what’s missing. The docs have no blueprints, no crafting XP and no benches players place. If you want a rule of your own, you write code on ox_inventory’s craftItem hook, which can stop a craft. And ox_inventory doesn’t support QBCore, so on a QBCore server with qb-inventory the benches aren’t an option without changing inventory.
Our Crafting script
This suits a server where crafting should be earned. Gangs unlock guns with blueprints, players level up as they craft, and crews put a bench in their own hideout.
It runs on ESX, Qbox and QBCore, with ox_inventory or qb-inventory. On Qbox it uses Qbox’s QBCore support. It needs oxmysql or mysql-async. ox_target and ox_lib are optional.
Every table lives in SvConfig in sv_config:
coordsplaces a table, with a prop spawned there if you want one.modelsturns every object of that model on the map into a table.itemsholds the recipes. Each has itsneededItems, adurationandxp = { need, get }.needBlueprintlocks it behind a blueprint, andshowWithoutBlueprintandshowWithoutXPdecide whether players still see a recipe they can’t craft yet.tableItemslists items that place a table when used.canPickup,onlyOwnerandcanPolicedecide who can pick it up again.jobslimits the table to job names and minimum grades.
An ingredient with keep = true is needed but not used up. A blueprint is an item named blueprint_ plus the crafted item’s name in lower case, so WEAPON_ASSAULTRIFLE needs blueprint_. Players check their XP with /craftingxp. Admins set it with setxp <playerId> <xp> in the server console, or in game with the command ace (commands).
A few things to know before you buy:
- No item list comes with it. Every item your recipes name, blueprints included, has to exist in your inventory. How to add items to ox_inventory shows where they go for each inventory.
- The script is protected by Cfx.re Asset Escrow.
config,.lua sv_config, the framework files and the editable files stay open..lua CanCraftinserver/runs before every craft and returnsmain_editable.lua trueas shipped, so you can add your own rule there.
Which fits your server
- You run QBCore with qb-inventory: a crafting script, since ox_inventory’s benches need ox_inventory.
- You run ox_inventory and want a few fixed recipes: use its benches. They cost nothing and need no extra resource.
- Recipes should unlock over time, or crews should set up tables where they like: our Crafting. It’s sold on its own, and it’s also in our Ultimate plan, which “Includes ALL current scripts and ALL future releases”. See the plans page.
- You want both: the two read separate files, so we’d expect them to run side by side. Keep the fixed recipes on ox_inventory benches and put the locked ones in Crafting.
