Skip to content

Main Config

The main configuration file is located at sd-crafting/configs/config.lua. It controls locale, commands, crafting behavior, queue persistence, blueprints, tools, inventory staging, leveling, shops, placeable workbenches, and static stations.

The file returns a single Lua table. All settings are accessed as properties of this table (e.g. Config.Debug).

Locale

lua
Locale = 'en',

Defines which language file to load from the locales/ folder. Available options: 'en' (English), 'de' (German).

Commands

lua
Commands = {
    placeWorkbench = 'placeworkbench',
    craftAdmin = 'craftadmin',
},
KeyDefaultDescription
placeWorkbench'placeworkbench'Chat command to place a workbench prop and print coordinates to the F8 console
craftAdmin'craftadmin'Chat command to open the crafting admin panel

Debug

lua
Debug = false,
DebugVerbose = false,
SettingDefaultDescription
DebugfalseEnable debug prints in the server console
DebugVerbosefalseEnable verbose debug prints that log every queue tick per second -- very noisy, only use for troubleshooting

Max Inventory Weight

lua
MaxInventoryWeight = 120000,

Fallback value (in grams) used when the script cannot automatically detect the player's max inventory weight from the inventory system. The script attempts auto-detection from ox_inventory, qb-inventory, qs-inventory, codem-inventory, and origen_inventory.

Default: 120000 (120 kg)

Crafting Behavior

These are the global defaults for crafting behavior. They can be overridden per-station (in Stations) or per-placeable workbench (in PlaceableWorkbenches) by adding a CraftingBehavior table. Partial overrides are supported -- any missing settings fall back to these global defaults.

lua
CraftingBehavior = {
    preventCloseWhileCrafting = true,
    cancelCraftOnClose = false,
    allowCraftingNearby = {
        enabled = false,
        distance = 5.0,
    },
    allowCraftingAnywhere = {
        enabled = false,
        notifyPlayer = false,
    },
    sharedCrafting = {
        placed = true,
        static = false,
    },
},

preventCloseWhileCrafting

ValueBehavior
true (default)Player cannot close the UI while crafting -- they must cancel or wait for completion
falsePlayer can close the UI freely while crafting

cancelCraftOnClose

Only applies when preventCloseWhileCrafting is false.

ValueBehavior
trueClosing the UI cancels the craft and refunds materials
false (default)Closing the UI does not cancel the craft

allowCraftingNearby

Only applies when both preventCloseWhileCrafting and cancelCraftOnClose are false.

KeyDefaultDescription
enabledfalseWhen true, crafting continues while the player stays within distance meters of the workbench
distance5.0Maximum distance from the workbench to continue crafting

allowCraftingAnywhere

KeyDefaultDescription
enabledfalseWhen true, the player can start a craft, close the menu, and go anywhere while it completes
notifyPlayerfalseWhen true, the player is notified when crafting completes even if far away

INFO

When the UI is closed and crafting completes via allowCraftingAnywhere, items go to the crafting stash (since the player may not be near the workbench). If the player has the UI open when crafting completes, items follow the AddOutputToStash setting instead.

sharedCrafting

KeyDefaultDescription
placedtrueWhen true, all users of a placed workbench share the same crafting queue
staticfalseWhen true, all users of a static station share the same crafting queue

Output Destination

lua
AddOutputToStash = true,
ValueBehavior
true (default)Crafted items are added to the crafting inventory/stash instead of the player's inventory
falseCrafted items go directly into the player's inventory

Fail Chance

lua
FailChance = {
    treatQuantityAsWhole = false,
},
ValueBehavior
trueOne roll for the entire batch -- all items succeed or all fail together
false (default)Each item is rolled individually -- some may succeed, some may fail

Example with 25% fail chance crafting 10 items:

  • treatQuantityAsWhole = true -- Either all 10 succeed or all 10 fail (one 25% roll)
  • treatQuantityAsWhole = false -- Each item rolls separately, average ~7-8 succeed, ~2-3 fail

Queue Persistence

Tick Down When Offline

lua
TickDownQueueWhenOffline = false,
ValueBehavior
trueCrafting time continues to tick down even when the server/script is offline. If a craft completes while offline, items are added to the crafting stash on next start
false (default)The queue resumes from where it left off -- remaining time stays the same

INFO

This only affects server/script restarts. For player disconnects, the server always continues ticking down craft timers while a player is away (unless CancelCraftOnLeave is true).

Cancel Craft on Leave

lua
CancelCraftOnLeave = true,
ValueBehavior
true (default)If a player disconnects or crashes while crafting, their entire queue is cancelled and ingredients are refunded to the station's staging inventory
falseThe server continues counting down the craft timer while the player is away. Completed items go to the staging inventory. On reconnect the player is notified how many items completed

WARNING

It is highly recommended to leave this as true. Offline crafting can cause erratic behavior and is considered non-functioning by the developer.

INFO

Recipe costs (money) are not refunded when a queue is cancelled due to player disconnect, since the player is offline at the time of cancellation.

Periodic Queue Save

lua
PeriodicQueueSave = {
    enabled = false,
    interval = 10,
},

Queues are always saved on player disconnect, server shutdown (txAdmin), and queue completion. This setting controls whether to also save periodically during gameplay.

KeyDefaultDescription
enabledfalseEnable periodic saves. Only needed if you frequently restart the resource (not the server) during testing
interval10Save interval in seconds

TIP

The txAdmin shutdown handler reliably saves all data. You only need periodic saves if you are hot-restarting the resource on a live server. Keep this false for production.

Blueprints

lua
Blueprints = {
    enabled = true,
    destroyOnCraft = {
        enabled = false,
        chance = 15,
    },
    durability = {
        enabled = true,
        defaultDurability = 100,
        defaultLoss = 10,
    },
},

Top-Level

KeyDefaultDescription
enabledtrueMaster toggle for the entire blueprint system

destroyOnCraft (Legacy System)

A simple random-destruction system. Disabled when durability is enabled.

KeyDefaultDescription
enabledfalseEnable random blueprint destruction on craft
chance15Percentage chance (0-100) to destroy the blueprint each craft

durability (ox_inventory only)

Uses item metadata to track blueprint wear. Overrides destroyOnCraft when active.

KeyDefaultDescription
enabledtrueEnable the durability system (requires ox_inventory)
defaultDurability100Default max durability for new blueprints
defaultLoss10Default durability loss per craft, used when a recipe does not specify blueprintDurabilityLoss

Tools

lua
Tools = {
    enabled = true,
    durability = {
        enabled = true,
        defaultDurability = 100,
        defaultLoss = 10,
    },
},
KeyDefaultDescription
enabledtrueMaster toggle for the tool requirement system

durability (ox_inventory only)

KeyDefaultDescription
enabledtrueEnable durability consumption for tools (requires ox_inventory)
defaultDurability100Default max durability for tools
defaultLoss10Default durability loss per craft, used when a tool does not specify durabilityLoss

Inventory Panel

lua
InventoryPanel = {
    enabled = true,
    showAllItems = true,
    maxSlots = 20,
    maxWeight = 500000,
    perWorkbench = {
        placed = true,
        static = false,
    },
    returnOnClose = false,
},
KeyDefaultDescription
enabledtrueShow the inventory panel with staging functionality
showAllItemstrueShow all items in the player's inventory (true) or only items used in recipes (false)
maxSlots20Maximum number of slots in the crafting inventory
maxWeight500000Maximum weight in the crafting inventory (in grams). 0 = unlimited
returnOnClosefalseReturn staged items to the player's inventory when closing the UI

perWorkbench

Controls whether staged items are stored per-workbench (shared between all players) or per-player.

KeyDefaultDescription
placedtruetrue = shared per-workbench for placed workbenches; false = per-player
staticfalsetrue = shared per-workbench for static stations; false = per-player

Leveling

lua
Leveling = {
    enabled = true,
    perWorkbenchType = true,
    defaultXpReward = {
        enabled = true,
        amount = 5,
    },
    levels = {
        [1] = 0, [2] = 100, [3] = 250, [4] = 500, [5] = 850,
        [6] = 1300, [7] = 1900, [8] = 2650, [9] = 3550, [10] = 4600,
    },
    maxLevel = 10,
    workbenchTypes = { ... },
},
KeyDefaultDescription
enabledtrueMaster toggle for the leveling system
perWorkbenchTypetruetrue = separate levels per workbench type; false = single global crafting level

defaultXpReward

KeyDefaultDescription
enabledtrueWhen false, recipes without an xpReward field give no XP
amount5Default XP amount when a recipe does not specify xpReward

levels

The default level-up XP thresholds. Each key is the level number, each value is the cumulative XP required to reach that level. Used as a fallback when perWorkbenchType is false, or when a workbench type does not define its own levels.

Default max level: 10

workbenchTypes

Per-workbench-type level configurations (only used when perWorkbenchType = true). Each entry can define its own levels table and maxLevel. If a type is not defined here, the default levels above are used.

lua
workbenchTypes = {
    ['basic'] = {
        levels = { [1] = 0, [2] = 100, ... [10] = 4600 },
        maxLevel = 10,
    },
    ['advanced'] = {
        levels = { [1] = 0, [2] = 200, ... [15] = 24200 },
        maxLevel = 15,
    },
},

Shops

lua
Shops = {
    ['workbench_vendor'] = {
        label = 'Workbench Vendor',
        coords = vector3(342.95, -1298.04, 32.51),
        heading = 159.2,
        model = 's_m_m_autoshop_02',
        spawnRadius = 50.0,
        scenario = 'WORLD_HUMAN_CLIPBOARD',
        useItemImages = false,
        blip = {
            enabled = true,
            sprite = 566,
            color = 2,
            scale = 0.7,
            label = 'Workbench Vendor',
        },
        items = {
            {
                id = 'workbench',
                label = 'Basic Workbench',
                description = 'A small portable workbench for crafting on the go',
                icon = 'fa-solid fa-toolbox',
                price = 5000,
            },
        },
    },
},

Shop Configuration

KeyTypeDescription
labelstringDisplay name of the shop
coordsvector3Position of the ped in the world
headingnumberDirection the ped faces (0-360)
modelstringGTA V ped model name
spawnRadiusnumberDistance at which the ped spawns
scenariostringPed animation/scenario while idle
useItemImagesbooleantrue = use item images from inventory; false = use the icon defined per item
bliptableMap blip configuration (see below)
itemstableArray of items this shop sells

Blip Configuration

KeyTypeDescription
enabledbooleanShow a map blip for this shop
spritenumberBlip sprite ID
colornumberBlip color ID
scalenumberBlip scale
labelstringBlip label on the map

Shop Item Configuration

KeyTypeDescription
idstringThe inventory item name given on purchase
labelstringDisplay name in the shop UI
descriptionstringDescription text in the shop UI
iconstringFontAwesome icon class (used when useItemImages = false)
pricenumberPrice in dollars
currencystring(Optional) Payment type: 'cash', 'bank', etc.

Placement Settings

lua
useGizmo = false,
raycastDistance = 10.0,
raycastFlags = -1,
KeyDefaultDescription
useGizmofalsetrue = use object_gizmo for placement; false = use raycast placement
raycastDistance10.0Max distance for raycast placement (only used when useGizmo = false)
raycastFlags-1Raycast collision flags. -1 = everything (works with housing shells). Default 339 may not detect shell interiors

Permissions

lua
Permissions = {
    enabled = true,
},

When enabled, only the owner and players they explicitly add can use placed workbenches. A permissions tab appears in the UI for placed workbenches.

History

lua
History = {
    enabled = true,
    maxEntries = 100,
    ownerOnlyDelete = true,
    dateFormat = 'DMY',
},
KeyDefaultDescription
enabledtrueShow the history tab in the UI. History is always saved to the database regardless of this setting
maxEntries100Maximum history entries per workbench. Oldest entries are removed when the limit is exceeded
ownerOnlyDeletetruetrue = only the workbench owner can delete history entries; false = anyone with access can delete
dateFormat'DMY'Date display format: 'DMY' for DD/MM/YYYY or 'MDY' for MM/DD/YYYY

Placeable Workbenches

See the dedicated Placeable Workbenches page for full details.

Static Stations

lua
Stations = {
    ['workbench'] = {
        label = 'Workbench',
        type = 'basic',
        coords = vector3(-1.89, -200.97, 52.74),
        heading = 340.7,
        radius = 2.0,
        recipes = { 'all', 'basic' },
        techTrees = { 'basic_survival', 'basic_exploration' },
        -- job = { name = 'mechanic', minGrade = 0 },
        -- gang = 'ballas',
        -- CraftingBehavior = { ... },
        prop = {
            enabled = true,
            model = 'prop_tool_bench02',
            spawnRadius = 50.0,
            offset = vector3(0.0, 0.0, -1.0),
        },
        blip = {
            enabled = true,
            sprite = 566,
            color = 2,
            scale = 0.7,
            label = 'Workbench',
        },
    },
},

Station Configuration

KeyTypeRequiredDescription
labelstringYesDisplay name in the UI and target prompt
typestringYesWorkbench type for per-workbench leveling (e.g. 'basic', 'advanced')
coordsvector3YesWorld position of the station
headingnumberYesHeading for the prop (0-360)
radiusnumberYesInteraction radius around the station
recipestableYesArray of recipe table names from configs/recipes.lua (e.g. { 'all', 'basic' })
techTreestableNoArray of tech tree IDs from configs/techtrees.lua
jobtableNoJob lock: { name = 'mechanic', minGrade = 0 }
gangstringNoGang lock (QBCore only): 'ballas'
CraftingBehaviortableNoOverride global crafting behavior for this station (partial overrides supported)
proptableNoProp configuration (see below)
bliptableNoMap blip configuration

Station Prop

KeyTypeDescription
enabledbooleanWhether to spawn a prop at this station
modelstringGTA V prop model name
spawnRadiusnumberDistance at which the prop spawns
offsetvector3Offset from coords (use Z offset for ground level adjustment)

Logging

Logging is configured in a separate file: sd-crafting/configs/logs.lua. See the source file for the full list of configurable events, placeholders, and service options.

Supported Services

ServiceDescription
'discord'Send logs to Discord via webhook
'fivemanage'Send logs to Fivemanage dashboard
'fivemerr'Send logs to Fivemerr (fm-logs)
'loki'Send logs to Loki/Prometheus stack
'grafana'Send logs to Grafana Cloud
'none'Disable all logging

Logged Events

craft_started, craft_completed, craft_failed, craft_cancelled, station_opened, station_closed, shop_purchase, shop_purchase_failed, blueprint_used, blueprint_broken, techtree_unlocked, xp_gained, level_up, error_occurred

Each event can be individually enabled/disabled and customized with title, description, color (Discord only), and structured fields.