Crafting System

Currently for Quasar Inventory you do not need any DLC or additional paid resources, which means that it is not necessary to purchase additional expansions to access this functionality.

The Quasar Inventory crafting system is very complete, it includes multiple functions to make it extremely customizable.

Can I disable the Crafting system?

Of course, you can disable the system completely, which will lower the consumption on the client side and you will be able to make use of other external Crafting systems. To disable the system simply disable Config.Crafting.

Reputation and threshold system for crafting (qbcore only)

In case you are a qbcore user, you have the option to add reputation to crafting using rep. By default we will find craftingrep or attachmentcraftingrep which you can use by following the texts that you will see below. To use this system we depend on Config.CraftingReputation enabled as well as Config.ThresholdItems, do not use this using esx as it will not work.


Basic use of crafting

Enter the config folder to see the crafting.lua file, where you will find multiple crafting examples and general explanations about this system.

This is a basic example taken from config/crafting.lua as an example of use:

[1] = {
    name = "weapon_pistol", -- Item you craft
    amount = 50, -- Quantity available, place what you want
    info = {}, -- Ignore this if you don't know the qb info
    costs = {
        ["iron"] = 80, -- These are the dependency items for the craft
        ["metalscrap"] = 120,
        ["rubber"] = 8,
        ["steel"] = 133,
        ["lockpick"] = 5,
    },
    type = "weapon", -- Put if it is 'item' or 'weapon'
    slot = 1, -- This is the slot inside crafting, keep order
    rep = 'attachmentcraftingrep', -- Type of reputation, read above its configuration (qb only)
    points = 1,
    threshold = 0, -- Points that you will receive when crafting, is reputation (qb only)
    time = 5500, -- Progress bar time
    chance = 100 -- Chance of breaking, 1-100 (100 imposible breaking)
},

Integration into external assets

This integration requires basic programming knowledge, do not proceed if you do not have it or a trusted developer to help you.

With this event we give an example of how to add custom crafting to your other assets, you can modify everything to make it perfect for your other asset.

function OpenCrafting()
    local CustomCrafting = {
        [1] = {
            name = 'weapon_pistol',
            amount = 50,
            info = {},
            costs = {
                ['tosti'] = 1,
            },
            type = 'weapon',
            slot = 1,
            rep = 'attachmentcraftingrep',
            points = 1,
            threshold = 0,
            time = 5500,
            chance = 100
        },
        [2] = {
            name = 'water_bottle',
            amount = 1,
            info = {},
            costs = {
                ['tosti'] = 1,
            },
            type = 'item',
            slot = 2,
            rep = 'attachmentcraftingrep',
            points = 1,
            threshold = 0,
            time = 8500,
            chance = 100
        },
    }

    local crafting = {
        label = 'Craft',
        items = exports['qs-inventory']:SetUpCrafing(CustomCrafting)
    }
    TriggerServerEvent('inventory:server:SetInventoryItems', CustomCrafting)
    TriggerServerEvent('inventory:server:OpenInventory', 'customcrafting', crafting.label, crafting)
end

Last updated