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
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
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
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
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.
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",
},
}
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:
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 ifConfig.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,
}
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,
},
}
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
}
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