Skip to content

Installation

1. Dependencies

Make sure these are installed and started before the crafting system:

  • Your framework: qb-core, qbx_core or es_extended
  • ox_lib
  • oxmysql
  • vns-core - free and open source, downloaded separately from your Keymaster/cfx Portal (it is not inside the script zip and updates on its own)
  • A target system (ox_target, qb-target or qtarget) - only needed for container benches, the door lock/unlock runs through target

vns-core detects your framework, inventory and target system automatically. The crafting system has no framework, inventory or target settings of its own.

2. Resource

Copy the vns-crafting folder into your resources and start it after vns-core:

ensure qb-core        # or qbx_core / es_extended
ensure ox_lib
ensure oxmysql
ensure vns-core
ensure vns-crafting

Ensure order

  • vns-core must be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.
  • vns-crafting must be ensured after vns-core.

If vns-core starts too early, VNS scripts can't use your database, items, money or other systems. See Installing vns-core.

Folder name

The folder must be named vns-crafting. Both the client and server script refuse to run under any other name and print a warning in the console.

3. Database

Nothing to import. On first start the script creates its own table, vns_crafting_levels, which stores each character's crafting XP.

4. Items

Every recipe result, every ingredient and every container key must exist as an item in your inventory. The default config expects common material items (metalscrap, iron, steel, rubber, screw, spring, aluminum, glass, ...), a set of blueprint_* items for the weapon recipes and a key1 item for the container doors. Add the ones you keep and remove the recipes you don't need.

5. Item icons

The menu loads item icons from the image folder vns-core detects for your inventory. If your icons live somewhere else, set Config.ItemImagePath in vns-core/config.lua. Items without an image fall back to a default icon.

6. Commands

Command Permission What it does
/setxp [server id] [amount] vns-core admin permission (Config.AdminAce, command by default), or the server console Sets a player's crafting XP to the given value.

There are no keybinds - players press E at a bench and use the mouse in the menu.

7. First start

  1. Start the server and check the console for errors.
  2. Walk to a workbench from the default config (bench 1 is at 101.51, 6616.3, 32.44) and press E within 1 m - the crafting menu opens.
  3. For a container bench, carry the configured key item and use the Lock/Unlock door target option first.

Config changes need a restart

config.lua is sent from the server to each client when their character loads. After editing it, restart the resource.

Encrypted variant

config.lua, client/client_open.lua and server/server_open.lua stay editable in the Encrypted variant - everything on this page and the Configuration page can be changed in both variants.

Updating from the previous version

  • vns-core is now required, and the script now also runs on QBox and ESX.
  • Removed options: Config.Target and Config.InventoryImages. The target system is detected by vns-core; item icons come from vns-core's Config.ItemImagePath.
  • Crafting XP moved to vns_crafting_levels, created automatically. Existing QBCore craftingrep metadata is copied over the first time each player is looked up, so nobody loses progress.
  • /setxp uses the vns-core admin permission instead of the QBCore god permission.
  • Level is checked on the server. With Config.HideWhenCantCraft = false, locked recipes are still shown, but crafting them is now refused with the notenoughlevel text.
  • More server checks. Crafting now also verifies the bench offers the recipe, the container is unlocked, the player is at the bench and the time window allows it (cannotcraftnow).
  • Key durability changed - see Key durability for how it is tracked now.
  • New texts in Config.Lang: notenoughlevel and cannotcraftnow.