Configuration

How to configure script

๐Ÿ”ง Main Configuration

This section covers the general configuration for the building system. You can edit these values in the configuration file to adjust the system to your needs.


๐Ÿž Debug

Config.Debug = true             -- Show debug messages in console
Config.DebugZones = false       -- Show debug zones areas
Config.DebugProps = false       -- Show debug props areas
Option
Description
Default Value

Config.Debug

Shows debug messages in the console.

true

Config.DebugZones

Visually shows building zones on the map.

false

Config.DebugProps

Visually shows the spawned props.

false

๐Ÿ‘๏ธ View Distances

Config.DistanceView = 300.0     -- Distance to view the props
Config.DistanceTerritory = 50.0 -- Distance to view the territory
Option
Description
Default Value

Config.DistanceView

Maximum distance to view props.

300.0

Config.DistanceTerritory

Distance to view the territory zones.

50.0

๐Ÿ› ๏ธ Maintenance System

--[[
    Maintenance system
    This system will remove the props if the player doesn't have enough materials
    to maintain the props.

    If disabled, the props are never removed.
--]]
Config.MaintenanceSystem = true -- Enable the maintenance system
Config.DaysToMaintain = 7       -- Days to maintain the props
Option
Description
Default Value

Config.MaintenanceSystem

Enables or disables the maintenance system.

true

Config.DaysToMaintain

Number of days props can last before needing maintenance.

7

โ™ป๏ธ Removal and Material Refund

Config.RemoveRefundMaterialsPercent = 50 -- Percent of materials refunded when removing
Option
Description
Default Value

Config.RemoveRefundMaterialsPercent

Percentage of materials refunded when removing a prop.

50

๐Ÿ“– Opening the Builder Menu

To open the building book menu, the player must have a specific item:

Config.OpenBook = {
    item = "builderbook",
}

To open the builder menu, players must have a specific item in their inventory.

Field
Description
Example

item

The item required to open the build book.

"builderbook"

๐Ÿ’ก You can change the item to anything you want, as long as it exists in your inventory system.

For example, you could use "constructionmanual", "blueprint", or even something lore-specific.

If you prefer not to use an item at all, you can modify the check manually in the framework.lua file. There youโ€™ll find the logic that handles the item verification โ€” simply remove or rewrite that part to allow opening the menu freely or through another condition (e.g., a command or keybind).

๐Ÿงฑ Available Materials

Config.Data.Materials = {
    {
        id = "wood",
        name = "Wood",
        icon = "๐Ÿชต",
        description = "Harvested pine and oak",
    },
    {
        id = "stone",
        name = "Stone",
        icon = "๐Ÿชจ",
        description = "Extracted from quarries",
    },
    {
        id = "iron",
        name = "Iron",
        icon = "โš’๏ธ",
        description = "Forged in blacksmith",
    },
    {
        id = "cloth",
        name = "Cloth",
        icon = "๐Ÿงต",
        description = "Cotton fabric",
    },
}
ID
Name
Icon
Description

wood

Wood

๐Ÿชต

Harvested pine and oak

stone

Stone

๐Ÿชจ

Extracted from quarries

iron

Iron

โš’๏ธ

Forged in blacksmith

cloth

Cloth

๐Ÿงต

Cotton fabric

๐Ÿ’ก You can freely modify this list of materials.

  • You can add, remove, or rename materials according to your gameplay needs.

  • However, each material must have a matching item registered in your inventory system, otherwise players wonโ€™t be able to gather or use them.

  • The id field must match the item name exactly (e.g., wood, stone, etc.).

๐Ÿ—๏ธ Buildable Props

Config.Data.Props = {
    {
        id = "mp001_p_mp_flag01x",
        name = "Territory Flag",
        image = "./items/flag.png",
        description = "Your property flag. Place it on the ground to claim an area as yours.",
        materials = {
            { name = "wood",  amount = 100, icon = "./icons/wood.png" },
            { name = "stone", amount = 50,  icon = "./icons/stone.png" },
        },
        cost = {
            { name = "wood",  amount = 100, icon = "./icons/wood.png" },
            { name = "stone", amount = 50,  icon = "./icons/stone.png" },
        },
        jobs = false,
    },
    {
        id = "p_tentarmypup01x",
        name = "Little Tent",
        image = "./items/stent.png",
        description = "A small tent to sleep in.",
        materials = {
            { name = "wood",  amount = 20, icon = "./icons/wood.png" },
            { name = "cloth", amount = 50, icon = "./icons/cloth.png" },
        },
        cost = {
            { name = "wood",  amount = 5,  icon = "./icons/wood.png" },
            { name = "cloth", amount = 10, icon = "./icons/cloth.png" },
        },
        jobs = false,
    },
    -- Add more props here
}

Each object in Config.Data.Props defines a structure the player can build. Here's a breakdown of each field:

Field
Description

id

The model name of the prop (must match a valid in-game model).

name

The display name shown in the builder UI.

image

Path to the image displayed in the build menu.

description

Description of the prop shown to the player.

materials

Materials required to build the prop (only checked during placement).

cost

Materials needed to maintain the prop over time (if maintenance is enabled).

jobs

Job restriction. Set it to a table like { ["builder"] = true } to restrict usage to specific jobs.

๐Ÿ” Example with Job Restriction

jobs = {
    ["builder"] = true,
    ["engineer"] = true,
}

Only players with one of these jobs will see and be able to build the prop in the builder book.

๐Ÿง  Summary

  • โœ… The id field is the prop model you want to spawn in-game.

  • ๐Ÿงฑ materials define the construction cost (only required once when placing).

  • ๐Ÿงพ cost is the maintenance cost, used periodically if Config.MaintenanceSystem is enabled.

  • ๐Ÿ‘ท jobs (optional) restricts the prop to certain jobsโ€”others won't even see it in the book.

๐Ÿ“ฆ Blank Prop Template (for developers)

This template helps other developers create and register their own props easily:

-- Example of a custom prop
{
    id = "your_prop_model_here",
    name = "Your Prop Name",
    image = "./items/yourimage.png",
    description = "Short description of what this prop is.",
    materials = {
        { name = "wood", amount = 10, icon = "./icons/wood.png" },
        { name = "stone", amount = 5, icon = "./icons/stone.png" },
    },
    cost = {
        { name = "wood", amount = 2, icon = "./icons/wood.png" },
    },
    jobs = {
        ["builder"] = true,
        -- Add more job names if needed
    },
}

โœ… Tips for adding new props:

  • The id must match a valid in-game prop model.

  • image should point to a valid path in your resource files.

  • materials are used to build the prop.

  • cost is used for maintenance (if the maintenance system is enabled).

  • If you don't want job restrictions, just set jobs = false.

๐Ÿงฑ Prop Types & Behaviors

This section defines how each prop behaves, how it is categorized in the builder book, and any special functions or restrictions it may have.


๐Ÿ—‚๏ธ Prop Types

Config.Data.PropTypes = {
    [`foundation`] = "Foundation",
    [`wallplanks`] = "Wall",
    [`roof`] = "Roof",
    [`roofladder`] = "Roof",
    [`walldoor`] = "Wall",
    [`wallplankswindow`] = "Wall",
    [`p_windowvalbank01x`] = "Windows",
    [`p_beechers_ladder01x`] = "Ladder",
    [`wallconst`] = "Wall",
    [`rooft`] = "Roof",
    [`rooftanglext`] = "Roof",
    [`rooftanglein`] = "Roof",
    [`rooftplane`] = "Roof",
    [`p_door04x`] = "Door",           -- Can be opened/closed (requires walldoor)
    [`mp001_p_mp_flag01x`] = "Flag",  -- For territory claiming
    [`p_lightwallnbx02x`] = "Light",  -- Can be toggled on/off
    [`p_lantern05x`] = "Light",       -- Can be toggled on/off
}

๐Ÿงญ These types help categorize props in the UI and determine their in-game behavior.

๐ŸŒฟ Vegetation Removal

Some props automatically clear vegetation (like grass or bushes) underneath when placed:

Config.Data.PropRemoveVegetation = {
    [`foundation`] = true,
}
Prop Type
Removes Vegetation

foundation

โœ… Yes

โš™๏ธ Special Prop Functions

You can assign custom interactions to props. Here's an example:

Config.Data.PropFunctions = {
    [`s_lootablebedchest`] = {
        label = "Open Chest",
        key = 0x5415BE48, -- Default: "E"
        distance = 1.5,
        func = function(entity, propId, hashPermission)
            if hashPermission then
                exports["artz_camps"]:OpenChestID(propId, 10, 50000)
            end
        end,
    },
}
Field
Description

label

Text shown when player is near the prop

key

Control key hash to trigger the action

distance

Max distance to interact with the prop

func

Custom function executed when the key is pressed

๐Ÿ” hashPermission ensures only authorized players can interact.

๐ŸŽฎ Controls in Builder Book

Certain keys can remain active while the builder book is open:

Config.EnableControlsInBook = {
    0x4BC9DABB -- Push to Talk
}
Key Name
Description

0x4BC9DABB

Push to Talk allowed


โŒ Disabled Controls (While Building)

To avoid interference while navigating the book, these controls are disabled:

Config.DisabledControls = {
    0x07CE1E61, -- MOUSE1
    0xF84FA74F, -- MOUSE2
    0xCEE12B50, -- MOUSE3
    0xCC1075A7,
    0xF78D7337,
    0xFD0F0C2C,
    0xD0842EDF
}

๐ŸŒ Language Settings

Config.Locale = "en"

This sets the default language used by the system. If you plan to localize, use this field to switch between "en", "es", etc.

Last updated