πŸ”¨Craft Menu

🌐 Translations

  • You can edit translations in the html/translate.js file (fr, en, de, it, es, pt are already included).

  • System messages and tooltips are configured in config.lua under the Config.Txt table.


πŸ—„οΈ Database

  • Just run the script. The required table will be automatically created in your database (no manual action needed).


πŸšͺ Opening the Crafting Menu

There are two ways to open the crafting menu:

1. For the player's current job:

TriggerServerEvent("bt_craft:openCraftMenu")

2. For a specific job (e.g. "police"):

TriggerServerEvent("bt_craft:openCraftMenu", "police")

βž• How to Add a New Craft

To add a new recipe, edit your Config.Crafts table in the server script.

Example for the "smuggler" job:

luaCopierModifier["smuggler"] = {
    {
        itemcraft = "moonshine",     -- The item given to the player
        level = 2,                   -- Required job level to craft
        craftTime = 5,               -- Time in seconds per craft
        requires = {
            [1] = { {item="alcohol",quantity=2}, {item="corn",quantity=4} },  -- At least 2 alcohol OR 4 corn
            [2] = { {item="sugar",quantity=2}, {item="honey",quantity=1} },   -- At least 2 sugar OR 1 honey
            [3] = { {item="glassbottle",quantity=1} }                         -- 1 glassbottle (mandatory)
        }
    },
}
  • itemcraft: The item that will be produced.

  • level: The required crafting job level to unlock the recipe.

  • craftTime: Time in seconds to craft one item (will be multiplied by the chosen quantity).

  • requires: Each group (numbered) contains ingredient options; the player needs one option per group.

Tip: You can add as many recipes as you want for each job, and as many alternative ingredients per step as needed.

πŸ”Œ Server Export: exports.bt_craft:GetPlayerCraftLevelXP

This export allows you to synchronously retrieve the crafting level and XP of a player for a given job.

Usage

local level, xp = exports.bt_craft:GetPlayerCraftLevelXP(playerId, jobName)
print("Level:", level)
print("XP:", xp)
  • playerId : Server ID of the player.

  • jobName : The job to check (e.g. "smuggler", "police", etc.).

  • Returns:

    • level (integer) – The player’s current crafting level for the job.

    • xp (integer) – The player’s current XP for the job.

If the player or job does not exist yet, the function will return:

  • 1 for level

  • 0 for XP


Example

local jobName = "smuggler"
local level, xp = exports.bt_craft:GetPlayerCraftLevelXP(source, jobName)
print(("Player %d - %s: Level %d, XP %d"):format(playerId, jobName, level, xp))

Last updated