Config

The default configuration provided with Possible Crafting.

The default configuration provided with Possible Crafting.

Lua
return {    Debug = true,    Framework = "qb",    -----------------------------------------------------------------    -- Emote System Configuration    -- Allows players to play emotes while crafting (optional per bench/recipe)    -- resource: 'scully_emotemenu' or 'rpemotes-reborn' (or nil to disable)    -- Priority: Recipe emote > Bench emote > No emote    -----------------------------------------------------------------    EmoteSystem = {        enabled = true,        resource = 'scully_emotemenu', -- 'scully_emotemenu' or 'rpemotes-reborn'    },    -----------------------------------------------------------------    -- Logging Module Configuration    -- enabled: Set to true to enable logging of crafting events    -- service: Choose between 'oxlib' for ox_lib logging or provide Discord webhook URL    -----------------------------------------------------------------    loggingModule = {        enabled   = true,        service   = '', -- 'oxlib' or 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL'    },    UseOxNotifs = true,    -----------------------------------------------------------------    -- Notification Settings (when UseOxNotifs is enabled)    -- position: Position of notifications    -- duration: Default duration for notifications in milliseconds    -- icon: Default icon for crafting notifications    -----------------------------------------------------------------    NotificationSettings = {        position = 'top',         duration = 5000,              icon = 'fa-solid fa-hammer',         -- Specific notification types can override defaults        levelUp = {            position = 'top',                 duration = 7000,                   icon = 'fa-solid fa-star'        },        protectionStash = {            position = 'top',             duration = 8000,                      icon = 'fas fa-shield-alt'        },        speedUp = {            position = 'top',                duration = 3000,                      icon = 'fas fa-tachometer-alt'        }    },    -----------------------------------------------------------------    -- Batch Processing Configuration (prevents lag spikes from large crafting requests)    -- batchSize: Maximum items to process in a single batch (default: 25)    -- batchDelay: Milliseconds to wait between batches (default: 100)    -----------------------------------------------------------------    batchProcessing = {        batchSize = 25,        batchDelay = 100,    },    -----------------------------------------------------------------    -- Crafting progression settings - These should mirror your cw-rep setup    -----------------------------------------------------------------    DefaultLevels = {        { from = 0, to = 100 },        { from = 100, to = 250 },        { from = 250, to = 500 },        { from = 500, to = 1000 },        { from = 1000, to = 2000 },        { from = 2000, to = 3500 },        { from = 3500, to = 5000 },        { from = 5000, to = 7500 },        { from = 7500, to = 10000 },        { from = 10000, to = 15000 },    },    -----------------------------------------------------------------    -- Ingredient Saving System Configuration    -- Each category can have its own scaling for ingredient saving chances    -- The chance increases with player level, with different scaling per category    -----------------------------------------------------------------    IngredientSaving = {        enabled = true,        -- Base chance at baseLevel (0-100)        baseChance = 1,        -- Base level that cw-rep starts players         baseLevel = 1,        -- Maximum chance at max level (0-100)        maxChance = 10.0,        -- Scaling per level (percentage points per level)        scalingPerLevel = 1,        -- Category-specific multipliers (1.0 = normal scaling, 0.5 = half scaling, 2.0 = double scaling)        categoryMultipliers = {            general = 1.0,            hacking = 1.0,            food = 1.0,            medical = 1.0,            weapon = 1.0,            armor = 1.0,            electronics = 1.0,            automotive = 1.0,            dismantling = 0.5, -- Lower chance for dismantling since it already gives random items        },        -- Minimum level required to have any saving chance        minLevel = 1,        -- Maximum level for scaling (beyond this, use maxChance)        maxLevel = 10,    },    -----------------------------------------------------------------    -- Speed-Up Crafting Configuration    -- Allows players to perform skill checks to reduce crafting time    --    -- How it works:    --   - Players interact with a target zone while crafting to trigger a skill check    --   - On success, time is added to a "time bank" based on their skill level    --   - The time bank is then consumed by subsequent crafted items, making them finish faster    --   - Example: Level 10 player (10 second reduction) crafting 120 items at 10s each:    --     * Speed-up adds 10,000ms to time bank    --     * item 1: Uses 9,000ms from bank -> finishes in 1s    --     * item 2: Uses remaining 1,000ms from bank -> finishes in 9s    --     * item 3+: Bank empty -> finish in 10s each    --   - Multiple speed-ups can be used, each adding more time to the bank    --   - Requires at least 60 seconds of remaining crafting time to use    -----------------------------------------------------------------    SpeedUpCrafting = {        enabled = true,        -- Use seconds-based reduction instead of percentage-based        useSecondsReduction = true,              -- If true, uses seconds; if false, uses percentage        -- Base time reduction at level 1 (seconds if useSecondsReduction=true, otherwise percentage 0-100)        baseTimeReduction = 0.5,                   -- 0.5 second at level 0.5        -- Additional reduction per skill level (seconds or percentage points)        reductionPerLevel = 0.5,                   -- +0.5 second per level (so level 10 = 0.5 + (9 * 0.5) = 5 seconds)        -- Maximum time reduction cap (seconds if useSecondsReduction=true, otherwise percentage 0-100)        maxTimeReduction = 30,                   -- Cap at 30 seconds total reduction        -- Cooldown between speed-up attempts (milliseconds)        cooldown = 2500,                         -- 2.5 seconds between speed-up uses        -- Skill check difficulty (easy/medium/hard or custom table)        difficulty = { 'easy', 'easy', 'easy' }, -- 3 skill checks with increasing difficulty        -- Keys to use for skill check        keys = { '1', '2', '3', '4' },        -- Maximum speed-ups per crafting session        maxSpeedUps = 125,        targetZone = {            icon = "fas fa-tachometer-alt",            label = "Speed Up Crafting",            distance = 2.5        }    },    -----------------------------------------------------------------    -- Disconnection Protection System    -- Creates temporary stashes for players who disconnect during crafting    -- to prevent loss of ingredients and reduce compensation requests    -----------------------------------------------------------------    DisconnectionProtection = {        enabled = true,        -- Temporary stash settings        -- Note: Cleanup time is controlled by ox_inventory's 'inventory:cleartime' convar (default: 5 minutes) - Update that accordingly        stash = {            slots = 50,            weight = 100000,             -- Stash will be created at the bench location where they were crafting        },        -- Admin notification settings        adminNotification = {            enabled = true,            -- Discord webhook for admin notifications (optional)            webhook = '', -- 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL'            -- Which admin groups get notified in-game            adminGroups = {'admin', 'god'}, -- QBCore job names or ESX groups        },        adminCommand = {            name = 'liststashes',            help = 'List all active crafting protection stashes',            restricted = 'group.admin'        }    },    -----------------------------------------------------------------    --- Possible Integrations    -----------------------------------------------------------------    PossibleTerritories = false,    PossibleGangLevels = false,    -----------------------------------------------------------------    -- Bonus Rewards Configuration (Territory Aware)    -- These bonus rewards are applied in addition to regular territory rewards    -- when territories are enabled and player is in a gang    -----------------------------------------------------------------    BonusRewards = {        enabled = true,                                            global = {            bonusItems = { 'emerald', 'sapphire', 'ruby', 'diamond' }, -- List of items to randomly choose from            bonusAmount = 1, -- Amount of bonus item to add            bonusChance = 10, -- Chance (in %) to add bonus item (10 = 10%, which is 1/10)            bonusChanceDenominator = nil, -- Alternative: chance as 1 in X (e.g., 10 = 1/10 chance). If set, overrides bonusChance        },        -- Category-specific bonus configurations (overrides global for that category)        categories = {            food = {                bonusItems = { 'meat_boar', 'meat_deer', 'meat_rabbit', 'fish_salmon' },                 bonusAmount = 1,                bonusChance = 10,            },            hacking = {                bonusItems = { 'electronics', 'copper_wire', 'advanced_chip' },                 bonusAmount = 1,                bonusChance = 15,            },            general = {                bonusItems = { 'steel', 'plastic', 'rubber' },                bonusAmount = 2,                 bonusChance = 8,            },            dismantling = {                bonusItems = { 'scrap_metal', 'metal_sheet', 'rubber' },                 bonusAmount = 1,                bonusChance = 12,            },            jewelry = {                bonusItems = { 'gold_bar', 'silver_bar', 'emerald', 'ruby', 'sapphire', 'diamond' },                bonusAmount = 1,                bonusChance = 15,            },        }    },    -----------------------------------------------------------------    -- Recipe definitions    --   The key for each recipe (e.g., 'lockpick') is a unique identifier.    --   Example structure:    --     label         : Display name in the NUI.    --     category      : The category this recipe belongs to (used by benches with `useCategories = true`).    --     output        : A table defining the output item.    --       - item      : The ox_inventory item name.    --       - count     : The amount to give.    --       - metadata  : (Optional) A table of metadata for the item.    --     ingredients   : A table where keys are ox_inventory item names and values are the required quantity.    --     time          : Crafting duration in milliseconds.    --     levelRequired : Minimum skill level required to craft.    --     xpReward      : XP gained for the associated skill on successful craft.    --     emote         : (Optional) Emote name/command to play while crafting (overrides bench emote).    -----------------------------------------------------------------    Recipes = {        lockpick = {            label  = "Lockpick",            category = "general",            output = { item = "lockpick", count = 1 },            ingredients = {                steel = 2,                plastic = 1,            },            time = 5000,            levelRequired = 1,            xpReward = 5,            -- emote = 'mechanic', -- Optional: Emote to play while crafting this recipe            territoriesInfluenceReward = 0.1,            territoriesItemReward      = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 5 },            gangLevelsExperienceReward = 0.1,        },        bandage = {            label = "Bandage",            category = "general",            output = { item = "bandage", count = 1 },            ingredients  = {                cloth = 3,            },            time = 3000,            levelRequired = 1,            xpReward = 3,            territoriesInfluenceReward = 0.1,            territoriesItemReward      = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 5 },            gangLevelsExperienceReward = 0.1,        },        phonehacker = {            label = "Phone Hacker",            category = "hacking",            output = { item = "phonehacker", count = 1, },            ingredients  = {                copper_wore = 3,                steel = 1,                metal_sheet = 1,                phonehacker_blueprint = 1,            },            time = 7500,            levelRequired = 1,            xpReward = 3,            territoriesInfluenceReward = 0.1,            territoriesItemReward      = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 5 },            gangLevelsExperienceReward = 0.1,        },        atmhacker = {            label = "ATM Hacker",            category = "hacking",            output = { item = "atmhacker", count = 1, },            ingredients  = {                copper_wore = 3,                steel = 1,                metal_sheet = 1,                atmhacker_blueprint = 1,            },            time = 7500,            levelRequired = 1,            xpReward = 3,            territoriesInfluenceReward = 0.1,            territoriesItemReward      = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 5 },            gangLevelsExperienceReward = 0.1,        },                burger = {            label = "Bleeder Burger",            category = "food",            output = { item = "burger", count = 1, metadata = { quality = 100 } },            ingredients = {                bread = 1,                meat = 1,                lettuce = 1,                tomato = 1,            },            time = 4000,            levelRequired = 1,            xpReward = 2,            territoriesInfluenceReward = 0.1,            territoriesItemReward = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 5 },            gangLevelsExperienceReward = 0.1,        },                -----------------------------------------------------------------        -- Example Jewelry Recipe (to demonstrate bonus rewards)        -----------------------------------------------------------------        gold_ring = {            label = "Gold Ring",            category = "jewelry",            output = { item = "gold_ring", count = 1 },            ingredients = {                gold_bar = 2,                emerald = 1,            },            time = 8000,            levelRequired = 3,            xpReward = 10,            territoriesInfluenceReward = 0.2,            territoriesItemReward = 'black_money',            territoriesItemRewardAmount = { min = 5, max = 15 },            gangLevelsExperienceReward = 0.2,        },        -----------------------------------------------------------------        -- Dismantling Recipes        -- These recipes consume items with 0 durability and return random ingredients        -- isDismantling: true marks this as a dismantling recipe        -- dismantlingPool: table of possible ingredients with their weights        -----------------------------------------------------------------        dismantle_pistol = {            label = "Pistol",            category = "dismantling",            isDismantling = true,            output = { item = "scrap_metal", count = 1 }, -- Default output if no random ingredient is selected            ingredients = {                WEAPON_PISTOL = 1, -- Requires pistol with 0 durability            },            dismantlingPool = {                -- Each entry has item name, min/max count, and weight (higher = more likely)                { item = "plastic", min = 2, max = 4, weight = 20 },                { item = "metal_sheet", min = 1, max = 2, weight = 15 },            },            time = 8000,            levelRequired = 1,            xpReward = 8,            territoriesInfluenceReward = 0.1,            territoriesItemReward = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 3 },            gangLevelsExperienceReward = 0.1,        },        dismantle_smg = {            label = "SMG",            category = "dismantling",            isDismantling = true,            output = { item = "scrap_metal", count = 2 },            ingredients = {                WEAPON_MICROSMG = 1,            },            dismantlingPool = {                { item = "plastic", min = 2, max = 4, weight = 20 },                { item = "metal_sheet", min = 1, max = 2, weight = 15 },            },            time = 12000,            levelRequired = 2,            xpReward = 12,            territoriesInfluenceReward = 0.1,            territoriesItemReward = 'black_money',            territoriesItemRewardAmount = { min = 2, max = 5 },            gangLevelsExperienceReward = 0.1,        },        dismantle_phone = {            label = "Phone",            category = "dismantling",            isDismantling = true,            output = { item = "scrap_metal", count = 1 },            ingredients = {                phone = 1,             },            dismantlingPool = {                { item = "plastic", min = 2, max = 4, weight = 20 },                { item = "metal_sheet", min = 1, max = 2, weight = 15 },            },            time = 6000,            levelRequired = 1,            xpReward = 6,            territoriesInfluenceReward = 0.1,            territoriesItemReward = 'black_money',            territoriesItemRewardAmount = { min = 1, max = 3 },            gangLevelsExperienceReward = 0.1,        },    },
    -----------------------------------------------------------------    -- Crafting benches / locations    --   The key for each location (e.g., 'legion_workbench') is a unique identifier.    --    --   Target Zone:    --   You can use either a sphere or a box for the interaction zone.    --   - coords      : vector3 coordinates OR table of vector3 coordinates for multiple locations.    --   - radius      : (For sphere zones) The radius of the interaction area.    --   - length      : (For box zones) The length (x) of the box.    --   - width       : (For box zones) The width (y) of the box.    --   - heading     : (For box zones) The rotation of the box (or table of headings if multiple coords).    --    --   Access Control:    --   - job         : Restrict to job(s). Can be a string or a table of strings. `nil` for public.    --   - gang        : Restrict to gang(s). Can be a string or a table of strings. `nil` for public.    --    --   Recipe & Skill Configuration:    --   - useCategories : If `true`, the bench will display categories instead of a flat list.    --   - categories    : (if `useCategories = true`) A table defining the categories.    --     - [key]       : The category key (e.g., 'general'). Recipes with a matching `category` field will appear here.    --     - label       : The display name for the category in the UI.    --     - skill       : The `cw-rep` skill associated with this category (e.g., 'crafting').    --   - recipes       : (if `useCategories = false`) A list of recipe keys available at this bench.    --   - skill         : (if `useCategories = false`) The single `cw-rep` skill associated with all recipes at this bench.    -----------------------------------------------------------------    CraftingLocations = {        public_workbench = {            label = "Public Workbench",            coords = {                vec3(-2224.34, 268.37, 174.6),                vector3(-2218.84, 256.65, 174.61)            },            radius = 2.0,            useCategories = true,            categories = {                general = { label = "General", skill = "crafting" },                hacking = { label = "Hacking", skill = "hacking" },                dismantling = { label = "Dismantling", skill = "crafting" },                jewelry = { label = "Jewelry", skill = "crafting" }, -- Added jewelry category            },            blip = {                enable = true,                sprite = 643,                colour = 0,                scale = 0.8,            },            -- Optional: Emote to play while crafting at this bench (fallback if recipe has no emote)            -- emote = 'mechanic', -- Emote name/command for scully_emotemenu or rpemotes            debug = true        },
        dismantling_bench = {            label = "Dismantling Workbench",            coords = {                vec3(-2210.34, 280.37, 174.6),            },            radius = 2.0,            useCategories = true,            categories = {                dismantling = { label = "Dismantling", skill = "crafting" },             },            blip = {                enable = true,                sprite = 566,                colour = 6,                scale = 0.8,                label = "Dismantling Bench"            },            debug = true        },
        burgershot_kitchen = {            label = "Burger Shot Kitchen",            coords = vec3(-1193.8, -886.0, 13.8),            length = 1.6,            width = 0.8,            heading = 305.0,            job = "police",            skill = "cooking",            recipes = { "burger" },            debug = true        },    },    MaxQueueDistance = 5.0,    -----------------------------------------------------------------    -- Theme settings    -----------------------------------------------------------------    Theme = {        primary = {            [50] = "240, 249, 255",             [100] = "#e0f2fe",                   [200] = "#bae6fd",                   [300] = "#7dd3fc",                   [400] = "56, 189, 248",              [500] = "14, 165, 233",              [600] = "#0284c7",                   [700] = "3, 105, 161",               [800] = "#075985",                   [900] = "12, 74, 110",              [950] = "8, 47, 73"              }    },}
JDB-NET Logo
Partner Service

Self-hosted unlimited logs with managed Grafana

JDB-NET provides a self-hosted solution with unlimited logs, a fully managed Grafana instance, and unlimited users. Perfect for FiveM servers that need comprehensive logging and monitoring.

Check out JDB-NET