Documentation

Config

Explanations for all config values.

General Information

The editable configuration is located in shared/unlocked/config.lua.

Because we have extensive configuration files, nested tables is an inevitability. To keep track of which values are for which table we use the tablename.value convention. This can also stack, for example PlaceableBenches[x].boxZone.length.

Blueprints are real inventory items, so you also have to register the blueprint item in your inventory resource. See Blueprints for the exact code.

#Config.Settings

Master settings that control debug logging, leveling, blueprints, and the admin commands.

#debug

Enables debug logging for the resource. Only enable this in development environments because it prints extra diagnostic output to the console.

Example:

lua
debug = false

#Levels

Controls how much experience it takes to reach each level. XP is earned from a craft's experienceToGive, and the required amount grows every level so the progression keeps a curve instead of flattening out.

Example:

lua
Levels = {
    baseXp = 100,
    xpMultiplier = 1.5,
}

#Levels.baseXp

The base amount of XP required for the first level-up. Every level after that builds on top of this value.

Example:

lua
baseXp = 100

#Levels.xpMultiplier

The factor the required XP is multiplied by for each next level. With 1.5, the requirement grows 50% per level: 100 for level 1, 150 for level 2, 225 for level 3, 337.5 for level 4, and so on. Note that these stack, so reaching level 3 takes 100 + 150 = 250 XP in total.

Example:

lua
xpMultiplier = 1.5

#blueprintItem

The inventory item name used for blueprints. This has to match the item you register in your inventory resource, otherwise blueprints will not work.

Example:

lua
blueprintItem = "blueprint"

#blueprintUses

Controls how many times a blueprint can be used before it is consumed. A value of -1 means infinite uses, any other number limits the blueprint to that many crafts. The ["*"] entry is the default for all recipes that don't have a specific number set, and an exact recipe name takes precedence over the wildcard. This can be overridden per blueprint when giving it through the export or the admin command.

Example:

lua
blueprintUses = {
    ["*"] = -1,
}

#blueprintUses[x]

A per-recipe override. Use a craft's item name as the key to set a fixed amount of uses for that recipe only, falling back to the ["*"] default for everything else.

Example:

lua
blueprintUses = {
    ["weapon_snspistol"] = 3,
}

#commands

The admin commands the resource registers. Each entry defines the command strings that trigger it and the permission required to run it.

Example:

lua
commands = {
    addBlueprint = {
        commands = {"craft:addbp"},
        permission = "command",
    },
    removeBlueprint = {
        commands = {"craft:removebp"},
        permission = "command",
    },
    checkBlueprints = {
        commands = {"craft:checkbp"},
        permission = "command",
    },
    addXp = {
        commands = {"craft:addxp"},
        permission = "command",
    },
}

#commands.addBlueprint

Gives you a blueprint for a specific recipe, or a random blueprint if you pass random. The full command reference lives in Blueprints.

Example:

lua
addBlueprint = {
    commands = {"craft:addbp"},
    permission = "command",
}

#commands.removeBlueprint

Removes a matching blueprint from your inventory.

Example:

lua
removeBlueprint = {
    commands = {"craft:removebp"},
    permission = "command",
}

#commands.checkBlueprints

Prints all blueprints in your inventory to the console. Useful for debugging.

Example:

lua
checkBlueprints = {
    commands = {"craft:checkbp"},
    permission = "command",
}

#commands.addXp

Gives you crafting XP.

Example:

lua
addXp = {
    commands = {"craft:addxp"},
    permission = "command",
}

#commands[x].commands

The command strings that trigger the action. Pass an array with multiple strings to register aliases.

Example:

lua
commands = {"craft:addbp", "addbp"}

#commands[x].permission

The permission required to run the command. The default uses the command ACE permission, and the server console always has access.

Example:

lua
permission = "command"

#Config.BenchTypes

The workbench types you can assign to your workbenches. A type is just a name and a label; the real work happens when a craft or a bench references it. Every bench placed in the world has a type, and crafts can be restricted to one or more types.

#BenchTypes[x]

A bench type entry. The key is the type name you reference in Config.Crafts.benchType, the label is what players see in the UI.

Example:

lua
["weapons"] = {label = "Weapon Workbench"},

#BenchTypes[x].label

The label shown in the UI for this bench type.

Example:

lua
label = "Weapon Workbench"

#Config.PlaceableBenches

The workbenches players can place directly in the world. Each entry defines the prop that spawns, how close you need to be to interact, and the box zone used for targeting.

#PlaceableBenches[x]

A placeable workbench entry. The key is the bench's item name — this is the item players hold to place the bench.

Example:

lua
["crafting_bench"] = {
    label = "Crafting Workbench",
    prop = "prop_tool_bench02",
    targetDistance = 1.5,
    boxZone = {length = 2.0, width = 1.2, minZ = -1.0, maxZ = 0.0},
},

#PlaceableBenches[x].label

The label shown when targeting the placed bench.

Example:

lua
label = "Crafting Workbench"

#PlaceableBenches[x].prop

The prop model spawned when the bench is placed. Find models here.

Example:

lua
prop = "prop_tool_bench02"

#PlaceableBenches[x].targetDistance

How close a player has to be to interact with the placed bench.

Example:

lua
targetDistance = 1.5

#PlaceableBenches[x].boxZone

The box zone used for targeting the bench. The child values define the zone dimensions and vertical bounds.

Example:

lua
boxZone = {length = 2.0, width = 1.2, minZ = -1.0, maxZ = 0.0}

#PlaceableBenches[x].boxZone.length

The length of the box zone.

Example:

lua
length = 2.0

#PlaceableBenches[x].boxZone.width

The width of the box zone.

Example:

lua
width = 1.2

#PlaceableBenches[x].boxZone.minZ

The lower vertical bound of the box zone.

Example:

lua
minZ = -1.0

#PlaceableBenches[x].boxZone.maxZ

The upper vertical bound of the box zone.

Example:

lua
maxZ = 0.0

#Config.Images

Lets you override the inventory images of the items used in your crafts, so you don't have to paste the same URL everywhere. The resource normally pulls the image from your inventory's image path, so this table is only needed when you want a specific image or your inventory doesn't ship one for the item. You can use a direct URL, or reference an image name you placed in zyke_crafting/nui/images.

#Images[x]

An image entry. The key is the item name, the value is the image URL or the image filename from the nui/images folder.

Example:

lua
["iron"] = "https://r2.fivemanage.com/mS9apQyi6ahmBBRtVnQAv/iron.png"

#Config.Crafts

The crafting recipes. Each entry defines what gets crafted, what it costs, the level and bench type required, and how much XP it awards. The script ships with example recipes you can copy and build from.

#Crafts[x]

A single crafting recipe.

Example:

lua
{
    item = "weapon_snspistol",
    label = "SNS Pistol",
    level = 3,
    timeToCraft = 5,
    amount = 1,
    experienceToGive = 50,
    blueprint = true,
    benchType = "weapons",
    img = "https://r2.fivemanage.com/mS9apQyi6ahmBBRtVnQAv/weapon_snspistol.png",
    items = {
        {label = "Iron", item = "iron", amount = 3, img = Config.Images["iron"]},
    },
    tools = {
        {label = "Screwdriver", item = "screwdriverset", amount = 1, img = Config.Images["screwdriverset"]},
    },
},

#Crafts[x].item

The name of the item given when the craft finishes. This is also what you reference when giving blueprints and when restricting blueprint uses per recipe.

Example:

lua
item = "weapon_snspistol"

#Crafts[x].label

The display name of the crafted item, shown throughout the UI.

Example:

lua
label = "SNS Pistol"

#Crafts[x].level

The crafting level required to craft this item. If you're below it, the recipe stays locked until you level up. Combined with benchType, this also lets you keep certain benches for higher-level crafters.

Example:

lua
level = 3

#Crafts[x].timeToCraft

How long the craft takes, in seconds.

Example:

lua
timeToCraft = 5

#Crafts[x].amount

How many of the item are given per craft. Defaults to 1 if omitted.

Example:

lua
amount = 1

#Crafts[x].experienceToGive

The XP awarded when the craft finishes. Defaults to 0 if omitted.

Example:

lua
experienceToGive = 50

#Crafts[x].blueprint

Set to true when this recipe requires a blueprint to craft. Defaults to false. The blueprint is matched by the craft's item name, so the same item can have both blueprint-locked and free recipes at different levels.

Example:

lua
blueprint = true

#Crafts[x].benchType

Restricts the craft to benches placed with a matching type. Use a single string like "weapons" to allow it at one bench type, or a table like {"weapons", "general"} to allow it at several. Remove the field or set it to nil to make the craft available at every bench.

Example:

lua
benchType = "weapons"

#Crafts[x].img

The image shown for the craft in the UI. Falls back to your inventory's image for the item if omitted.

Example:

lua
img = "https://r2.fivemanage.com/mS9apQyi6ahmBBRtVnQAv/weapon_snspistol.png"

#Crafts[x].items

The materials consumed when you craft the item. Every listed item is removed from your inventory on craft.

Example:

lua
items = {
    {label = "Iron", item = "iron", amount = 3, img = Config.Images["iron"]},
}

#Crafts[x].items[y]

A single material requirement.

Example:

lua
{label = "Iron", item = "iron", amount = 3, img = Config.Images["iron"]},

#Crafts[x].items[y].label

The display name of the material, shown in the UI.

Example:

lua
label = "Iron"

#Crafts[x].items[y].item

The inventory item name of the material.

Example:

lua
item = "iron"

#Crafts[x].items[y].amount

How many of the material are consumed per craft.

Example:

lua
amount = 3

#Crafts[x].items[y].img

The image shown for the material. Falls back to your inventory's image for the item if omitted.

Example:

lua
img = Config.Images["iron"]

Items vs. Tools

The difference between items and tools is that materials are consumed when you craft, while tools are not. Tools just need to be in your inventory — and they stay there.

#Crafts[x].tools

The tools required to craft the item. Unlike items, tools are not consumed — they just need to be in your inventory, and they stay there after the craft.

Example:

lua
tools = {
    {label = "Screwdriver", item = "screwdriverset", amount = 1, img = Config.Images["screwdriverset"]},
}

#Crafts[x].tools[y]

A single tool requirement.

Example:

lua
{label = "Screwdriver", item = "screwdriverset", amount = 1, img = Config.Images["screwdriverset"]},

#Crafts[x].tools[y].label

The display name of the tool, shown in the UI.

Example:

lua
label = "Screwdriver"

#Crafts[x].tools[y].item

The inventory item name of the tool.

Example:

lua
item = "screwdriverset"

#Crafts[x].tools[y].amount

How many of the tool are required.

Example:

lua
amount = 1

#Crafts[x].tools[y].img

The image shown for the tool. Falls back to your inventory's image for the item if omitted.

Example:

lua
img = Config.Images["screwdriverset"]

Having trouble?

If you feel like we have explained any value poorly, please let us know on Discord so that we can update the documentation so that everyone understands it easily.