Skip to content

Professional crafting system for FiveM / Qbox with UI and level progression

License

Notifications You must be signed in to change notification settings

ABUGIZA/F4-Crafting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

F4 Crafting

Professional crafting system for FiveM / Qbox with UI and level progression.

Description

F4 Crafting is a modular crafting system for FiveM servers using the QBCore framework. It provides a polished UI, level progression, XP rewards, and configurable crafting recipes. Designed to work with ox_inventory or qb-inventory and integrate with ox_lib, oxmysql, interact, and object_gizmo.

Features

  • Interactive crafting UI with stations
  • Item level progression and XP rewards
  • Configurable crafting recipes and material requirements
  • Support for ox_inventory and qb-inventory
  • Integration with ox_lib, oxmysql, interact and object_gizmo
  • Persistent crafting queue saved in database
  • Table-bound crafting and claiming (same table required)
  • Ready-items panel with manual claim button (no auto-give)

Screenshots

Main UI - Item selection and crafting Main crafting UI - item selection, crafting preview and material requirements.

Alternate UI view Alternate view highlighting materials and controls.

In-game Workbench / Crafting Table Example in-game crafting table / workbench.

Requirements

Installation

  1. Execute f4_Crafting.sql in your database.
  2. Add to server.cfg:
ensure F4-Crafting

Configuration

Inventory System - edit shared/shared.lua:

F4.img = "ox_inventory"  -- "ox_inventory" or "qb-inventory"

Add crafting items - example:

F4.CraftingItems = {
    {
        name = 'Item Name',
        item = 'item_spawn_name',
        level = 0,
        description = 'Item description',
        xpReward = 10,
        requirements = {
            { item = 'steel', amount = 2, label = 'Steel' }
        }
    }
}

XP settings (example):

F4.XPPerLevel = 600
F4.XPPerHexagon = 100

Player Metadata Setup

Add the following lines to your qbx_core/server/player.lua file (around where other metadata fields are initialized):

playerData.metadata.crafting_level = playerData.metadata.crafting_level or 0
playerData.metadata.crafting_xp = playerData.metadata.crafting_xp or 0

This ensures every player starts with crafting progression data (level and XP) initialized properly.

Database

Execute the following SQL to create/update the crafting benches table:

CREATE TABLE IF NOT EXISTS `f4_crafting` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique identifier for each crafting bench',
    `x` FLOAT NOT NULL COMMENT 'X coordinate of the crafting bench',
    `y` FLOAT NOT NULL COMMENT 'Y coordinate of the crafting bench',
    `z` FLOAT NOT NULL COMMENT 'Z coordinate of the crafting bench',
    `heading` FLOAT NOT NULL COMMENT 'Heading of the crafting bench',
    `craft_queue` LONGTEXT NULL COMMENT 'Pending crafted items queue in JSON format',
    `queue_updated_at` DATETIME NULL DEFAULT NULL COMMENT 'Last queue update timestamp',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `f4_crafting`
    ADD COLUMN IF NOT EXISTS `craft_queue` LONGTEXT NULL COMMENT 'Pending crafted items queue in JSON format',
    ADD COLUMN IF NOT EXISTS `queue_updated_at` DATETIME NULL DEFAULT NULL COMMENT 'Last queue update timestamp';

Commands

  • /addcraftingtable - Add crafting bench (admin)
  • /removecraftingtable - Remove nearest crafting bench (admin)
  • /removecraftingtable [id] - Remove crafting bench by table id (admin)

Demo / Video

Watch the demo video: https://youtu.be/aEZfh85U2n4 Latest queue/table update demo: https://streamable.com/1qcyqe

Discord: https://discord.gg/CXYX39zkma

License

MIT License - include the full MIT license text in the LICENSE file.

Updates

Latest Updates (October 2025)

  1. Blueprint System Added

    • Introduced a professional blueprint system for crafting.
    • Add the following item to your ox_inventory/data/items.lua:
    ['blueprint'] = {
        label = 'Blueprint',
        weight = 50,
        stack = false,
        close = true,
        consume = 0,
        description = 'A professional crafting blueprint with detailed specifications and requirements',
        client = {
            image = 'blueprint.png'
        }
    },
  2. Dynamic Crafting Time System

    • Crafting time now scales based on the number of items being crafted.
    • More items means longer crafting time for realistic progression.
  3. Blueprint Distribution

    • Use the following command to give players blueprints:
    exports.ox_inventory:AddItem(src, 'blueprint', 1, { type = 'tools' })
  4. Live Demo

Latest Updates (February 2026)

  1. Persistent Queue System

    • Crafted items are no longer auto-added when timer ends.
    • Crafted outputs are stored in f4_crafting.craft_queue.
    • Items remain after reconnect or server restart.
  2. Table-Bound Claim System

    • Crafting jobs are tied to the same table where they started.
    • Players must claim from that table only.
    • Queue ownership is tied to player identity.
  3. Ready Items UI Panel

    • Added right-side queue panel with vertical rows.
    • Each row has its own Take button for manual claim.
    • Supports multiple different crafted item types.
  4. Admin Table Removal

    • Added /removecraftingtable and /removecraftingtable [id].
    • Removal sync is broadcast to all players.
    • Includes extra local cleanup path for stuck objects.
  5. Live Demo

About

Professional crafting system for FiveM / Qbox with UI and level progression

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published