Skip to content

Config Example

return {
    Debug = false,
    AccentColour = '#3b82f6',
    Locale = 'en',

    -- cw-rep: Set true if recipe minLevel is XP threshold (e.g. 100, 200). Set false (default) for
    -- level (1, 2, 3, 4) - uses client getCurrentLevel via callback.
    RecipeMinLevelIsXp = false,

    -- Placeable benches: item name -> bench type (each item places a different bench)
    -- Add each item to ox_inventory items.lua with server export 'jdbnet-crafting.UsePlaceableBench'
    PlaceableBenches = {
        ['crafting_bench_basic'] = 'workbench_basic',
        ['crafting_bench_advanced'] = 'workbench_advanced',
    },

    -- Placement adjustment settings
    Placement = {
        MoveStep = 0.05,
        RotateStep = 5.0,
        MaxDistance = 10.0,
    },

    -- Recipe groups: each group maps to a cw-rep skill
    -- Recipe order: use recipeOrder = {'id1','id2'} for hash format, or array format (see README)
    RecipeGroups = {
        weapons_pistol = {
            recipeOrder = { 'pistol', 'pistol_mk2', 'ap_pistol' },
            label = 'Pistols',
            skill = 'weapons_crafting',
            minLevel = 1,
            xpPerCraft = 5,
            recipes = {
                pistol = {
                    label = 'Pistol',
                    result = 'WEAPON_PISTOL',
                    count = 1,
                    duration = 5000,
                    minLevel = 1,
                    ingredients = {
                        metal_scrap = 10,
                        plastic = 5,
                    },
                },
                pistol_mk2 = {
                    label = 'Pistol Mk II',
                    result = 'WEAPON_PISTOL_MK2',
                    count = 1,
                    duration = 8000,
                    minLevel = 5,
                    ingredients = {
                        metal_scrap = 15,
                        plastic = 8,
                        steel = 5,
                    },
                },
                ap_pistol = {
                    label = 'AP Pistol',
                    result = 'WEAPON_APPISTOL',
                    count = 1,
                    duration = 10000,
                    minLevel = 10,
                    ingredients = {
                        metal_scrap = 20,
                        plastic = 10,
                        steel = 10,
                    },
                },
            },
        },
        ammo = {
            label = 'Ammunition',
            skill = 'ammo_crafting',
            minLevel = 1,
            xpPerCraft = 2,
            recipeOrder = { 'pistol_ammo' },
            recipes = {
                pistol_ammo = {
                    label = 'Pistol Ammo',
                    result = 'ammo-9',
                    count = 20,
                    duration = 3000,
                    minLevel = 1,
                    ingredients = {
                        metal_scrap = 3,
                        gunpowder = 2,
                    },
                },
            },
        },
    },

    -- Bench types: each defines which recipe groups it can craft
    BenchTypes = {
        workbench_basic = {
            label = 'Basic Workbench',
            prop = 'prop_tool_bench02',
            groups = { 'ammo' },
            blip = nil,
        },
        workbench_advanced = {
            label = 'Advanced Workbench',
            prop = 'prop_tool_bench02',
            groups = { 'weapons_pistol', 'ammo' },
            blip = { sprite = 478, color = 2, scale = 0.7 },
        },
        workbench_weapons = {
            label = 'Weapons Workbench',
            prop = nil,
            groups = { 'weapons_pistol' },
            blip = nil,
        },
    },

    -- Static benches in the world (spawn props or use existing locations)
    -- Add coords as vector4(x, y, z, heading)
    StaticBenches = {
        -- { benchType = 'workbench_advanced', coords = vector4(123.0, -1034.0, 29.28, 180.0) },
    },
}