Tool Item
Each tool is defined as a key in the tools table with a structured value. Here's a breakdown of the expected fields:
π Fields:
Field
Type
Required
Description
label
string
β
Display name of the item.
weight
integer
β
Weight in grams (e.g. 1000 = 1kg).
description
string
β
Description text shown in item UI.
chanceOfBreak
integer
β
Percent chance (0β100) the tool breaks on use.
holdRotation
vector3
β
Adjusts the rotation of the held object.
holdOffset
vector3
β
Adjusts the position offset when held.
model
string
β
Model name of the object to hold (e.g. "prop_tool_box_04"
).
useable
function
β
Function to execute when the item is used.
strength
integer
β
Max supported vehicle weight (in grams). Limits what vehicles this item works on.
π‘ Example
tools = {
wrench = {
label = "Wrench",
weight = 1000,
description = "A sturdy wrench for basic repairs.",
chanceOfBreak = 25, -- 25% chance of breaking
holdRotation = vector3(90.0, 0.0, 0.0),
holdOffset = vector3(0.0, -0.15, -0.02),
model = "prop_tool_wrench",
strength = 2000,
useable = function(src)
-- custom usage logic here
end
}
}
Last updated