Configuration Guide
Comprehensive configuration guide for noclip_crafting, covering all features and customization options.
config.lua
file. Make sure to restart the resource after making changes.
Table of Contents
- Basic Configuration
- Skill System
- Success/Fail System
- Critical Success System
- Police Alert System
- Weapon Repair System
- Crafting Locations
- Item Requirements
- Recipe Configuration
Basic Configuration
Core settings for the crafting system.
Basic Settings
Config = {
Debug = false, -- Enable debug mode
Lan = "en", -- Language setting
Notify = "ox", -- Notification system
blueprintCrafting = false, -- Enable blueprint crafting
toolboxTargets = false, -- Enable toolbox targets
}
Debug Mode
Enable debug mode to see detailed information about crafting operations, target zones, and system events.
Language Support
Currently supports English ("en"). Additional languages can be added to the locales
folder.
Skill System
Experience-based progression system with level requirements and skill bonuses.
Skill System Configuration
SkillSystem = {
enabled = true, -- Global toggle for skill system
maxLevel = 100, -- Maximum skill level
experienceMultiplier = 1.0, -- Global multiplier for experience gained
-- Experience required for each level (exponential growth)
baseExp = 100, -- Base experience required for level 1
expMultiplier = 1.5, -- Multiplier for exponential growth
-- Notification settings
showLevelUp = true, -- Show level up notifications
showExpGain = false, -- Show experience gain notifications
-- Default settings for recipes
defaultExpGain = 10, -- Default experience gained per craft
defaultLevelRequirement = 0, -- Default level required to craft
hideUntilLevel = false, -- Show recipe but disable if level too low
}
Per-Recipe Skill Settings
{
["weapon_pistol"] = { ["steel"] = 5, ["gunpowder"] = 2 },
amount = 1,
expGain = 50, -- Experience gained for this recipe
levelRequirement = 10, -- Required level to craft
hideUntilLevel = true, -- Hide until level requirement met
}
Success/Fail System
Dynamic crafting outcomes with success/failure chances based on skill level.
Success/Fail Configuration
SuccessFailSystem = {
enabled = true, -- Global toggle for success/fail system
-- Base success chance calculation
baseSuccessChance = 75, -- Base success chance (percentage)
skillBonusPerLevel = 1.0, -- Additional success chance per skill level
maxSuccessChance = 95, -- Maximum success chance (percentage)
-- Failure handling options
failureHandling = {
loseAllIngredients = false, -- Lose all ingredients on failure
losePartialIngredients = true, -- Lose some ingredients on failure
partialLossPercentage = 50, -- Percentage of ingredients lost on failure
keepCraftedItem = false, -- Keep crafted item even on failure
},
-- Byproduct system
byproducts = {
enabled = true, -- Global toggle for byproduct system
defaultByproductChance = 30, -- 30% chance to get byproducts
defaultByproductAmount = 1, -- Default amount of byproducts
defaultByproductTrigger = "failure", -- "success", "failure", "both"
},
-- Hazard system for dangerous crafting
hazards = {
enabled = true, -- Global toggle for hazard system
hazardTypes = {
["explosion"] = {
enabled = true,
chance = 15, -- 15% chance when crafting fails
damage = 25, -- Damage amount
radius = 3.0, -- Explosion radius
},
["poison"] = {
enabled = true,
chance = 20, -- 20% chance when crafting fails
damage = 15, -- Initial damage
dotDamage = 5, -- Damage over time
dotDuration = 10, -- Duration in seconds
},
},
},
}
Per-Recipe Success/Fail Settings
{
["advanced_weapon"] = { ["steel"] = 10, ["gunpowder"] = 5 },
amount = 1,
successChance = 40, -- Low base success chance
skillBonus = 2.0, -- High skill bonus per level
failureHandling = "full", -- Lose all ingredients on failure
successBonus = true, -- Enable success bonuses
failurePenalty = true, -- Enable failure penalties
hazards = true, -- Enable hazards for this recipe
hazardTypes = { "explosion", "poison" }, -- Multiple hazards
hazardChance = 50, -- 50% chance of hazard on failure
}
Critical Success System
Special outcomes that provide bonus rewards and material conservation.
Critical Success Configuration
CriticalSuccess = {
enabled = true, -- Global toggle for critical success system
-- Base critical success settings
baseCriticalChance = 5, -- Base 5% chance for critical success
skillBonusPerLevel = 0.5, -- Additional 0.5% chance per skill level
maxCriticalChance = 15, -- Maximum 15% critical success chance
-- Material conservation settings
materialConservation = {
enabled = true, -- Enable material conservation on critical success
conservationPercentage = 50, -- Percentage of materials saved
minimumConserved = 1, -- Minimum number of materials to conserve per type
},
-- Bonus rewards for critical success
bonusRewards = {
enabled = true, -- Enable bonus rewards on critical success
extraItemChance = 25, -- 25% chance to get extra crafted item
extraItemAmount = 1, -- Amount of extra items given
bonusExpMultiplier = 2.0, -- Double experience on critical success
-- Special rewards
specialRewards = {
enabled = true, -- Enable special rewards
chance = 10, -- 10% chance for special reward
rewardTypes = {
["rare_material"] = {
chance = 40, -- 40% chance for rare material
items = {
["pure_cocaine"] = { chance = 30, amount = 1 },
["pure_meth"] = { chance = 30, amount = 1 },
}
},
["money_bonus"] = {
chance = 30, -- 30% chance for money bonus
amount = { min = 100, max = 500 }, -- Random amount
},
}
}
},
}
Police Alert System
Enhanced police alert system with exact and randomized location reporting.
Police Alert Configuration
policeAlerts = {
enabled = true, -- Global toggle for police alert system
defaultLocationType = "randomized", -- "exact" or "randomized"
-- Location accuracy settings
locationAccuracy = {
exact = {
enabled = true,
chance = 30, -- 30% chance for exact location
description = "Exact location pinpointed",
blipFlash = true, -- Make blip flash for exact locations
blipScale = 1.0, -- Larger blip for exact locations
},
randomized = {
enabled = true,
chance = 70, -- 70% chance for randomized location
description = "General area detected",
offsetRadius = { min = 50, max = 200 }, -- Random offset
blipScale = 0.8, -- Smaller blip for general areas
searchArea = {
enabled = true,
radius = 100, -- Search radius around offset location
description = "Search this area for suspects",
}
}
},
-- Integration settings
integrations = {
ps_dispatch = {
enabled = true,
exactLocationCode = "10-90",
generalLocationCode = "10-91",
},
qb_dispatch = {
enabled = true,
exactLocationCode = "10-90",
generalLocationCode = "10-91",
}
}
}
Per-Recipe Police Alert Settings
{
["weapon_pistol"] = { ["steel"] = 5, ["gunpowder"] = 2 },
amount = 1,
policeAlertSuccess = 50, -- 50% chance to alert police on success
policeAlertFailure = 80, -- 80% chance to alert police on failure
policeAlertType = "weapon_crafting", -- Type of alert to send
policeAlertLocationType = "exact", -- "exact" or "randomized"
}
Weapon Repair System
Comprehensive weapon repair system with material requirements and outcome chances.
Weapon Repair Configuration
WeaponRepairSystem = {
enabled = true, -- Global toggle for weapon repair system
requiredTool = "toolkit", -- Required tool (not consumed)
defaultRepairTime = 10000, -- 10 seconds repair time
defaultDurabilityRestore = 100, -- Restore to 100% durability
-- Critical success settings
criticalSuccess = {
enabled = true, -- Enable critical success for repairs
baseChance = 10, -- 10% base chance
skillBonusPerLevel = 1.0, -- +1% per skill level
maxChance = 25, -- Maximum 25% chance
materialReduction = 50, -- 50% reduction in materials required
},
-- Failure settings
failure = {
enabled = true, -- Enable failure chance for repairs
baseChance = 15, -- 15% base chance
skillReductionPerLevel = 1.0, -- -1% per skill level
minChance = 5, -- Minimum 5% chance
materialConsumption = 25, -- 25% of materials consumed on failure
allowRetry = true, -- Allow retry after failure
},
-- Critical failure settings
criticalFailure = {
enabled = true, -- Enable critical failure
baseChance = 5, -- 5% base chance
skillReductionPerLevel = 0.5, -- -0.5% per skill level
minChance = 1, -- Minimum 1% chance
weaponDestruction = true, -- Destroy weapon on critical failure
replacementItems = { -- Items given instead of destroyed weapon
["weapon_parts"] = { chance = 60, amount = 1 },
["scrap_metal"] = { chance = 30, amount = 2 },
["gunpowder"] = { chance = 10, amount = 1 },
},
},
-- Weapon categories and their repair requirements
weaponCategories = {
["pistols"] = {
label = "Pistols",
skillName = "weapon_repair",
baseMaterials = {
["iron_ore"] = 2,
["steel_ingot"] = 1,
["gunpowder"] = 1,
},
criticalSuccessChance = 12,
failureChance = 12,
criticalFailureChance = 3,
},
["rifles"] = {
label = "Rifles",
skillName = "weapon_repair",
baseMaterials = {
["iron_ore"] = 4,
["steel_ingot"] = 2,
["gunpowder"] = 2,
["wood"] = 1,
},
criticalSuccessChance = 8,
failureChance = 18,
criticalFailureChance = 6,
},
},
}
Weapon Repair Bench Configuration
{
name = "Weapon Repair Bench",
coords = {
vector4(452.0, -980.0, 30.7, 90.0), -- Police station
vector4(-1108.0, -845.0, 19.3, 120.0), -- Gun shop
},
job = { ["mechanic"] = 0, ["police"] = 0, ["gunsmith"] = 0 },
blip = {
sprite = 566,
col = 1,
scale = 0.8,
},
prop = `prop_tool_bench02`,
weaponRepair = true, -- Enable weapon repair for this bench
weaponRepairSystem = {
skillName = "weapon_repair",
defaultRepairTime = 8000, -- 8 seconds for this bench
defaultDurabilityRestore = 100,
defaultCriticalSuccessChance = 12,
defaultFailureChance = 12,
defaultCriticalFailureChance = 3,
},
}
Crafting Locations
Configure multiple crafting benches with unique recipes and requirements.
Basic Location Configuration
Locations = {
{
name = "Basic Crafting Bench",
coords = {
vector4(123.45, 678.90, 12.34, 180.0),
},
blip = {
sprite = 566,
col = 1,
scale = 0.8,
},
prop = `prop_tool_bench02`,
job = { ["mechanic"] = 0 }, -- Optional job restriction
craftingTable = {
-- Recipe configuration here
},
},
}
Location Properties
- name: Display name for the crafting bench
- coords: Vector4 coordinates (x, y, z, heading)
- blip: Map blip configuration (optional)
- prop: 3D model prop for the bench
- job: Job restrictions (optional)
- requiredItems: Required items to access (optional)
- skillSystem: Skill system settings (optional)
- craftingTable: Recipe definitions
Item Requirements
Require specific items to access crafting benches.
Item Requirement Configuration
{
name = "Advanced Crafting Bench",
coords = { vector4(123.45, 678.90, 12.34, 180.0) },
prop = `prop_tool_bench02`,
-- Item requirement system (OR logic)
requiredItems = {
["crafting_toolkit"] = 1, -- Requires crafting toolkit
["advanced_blueprint"] = 1, -- OR requires advanced blueprint
["master_craftsman_license"] = 1, -- OR requires master craftsman license
},
-- Note: This uses OR logic - player needs ANY of these items to access the bench
craftingTable = {
-- Recipe configuration here
},
}
Recipe Configuration
Detailed recipe configuration with all available options.
Complete Recipe Example
craftingTable = {
["Weapons"] = {
["Advanced Pistol"] = {
{
["advanced_pistol"] = {
["steel"] = 10,
["gunpowder"] = 5,
["precision_parts"] = 2
},
amount = 1,
time = 15000, -- 15 seconds crafting time
anim = { "mini@repair", "fixing_a_ped" }, -- Custom animation
-- Skill system features
expGain = 100, -- Experience gained
levelRequirement = 25, -- Required level
hideUntilLevel = true, -- Hidden until level requirement met
-- Success/fail system features
successChance = 60, -- Base success chance
skillBonus = 1.5, -- Skill bonus per level
failureHandling = "partial", -- "none", "partial", "full"
successBonus = true, -- Enable success bonuses
failurePenalty = true, -- Enable failure penalties
-- Hazard system features
hazards = true, -- Enable hazards
hazardTypes = { "explosion", "poison" }, -- Multiple hazards
hazardChance = 30, -- Hazard chance on failure
-- Byproduct system features
byproducts = true, -- Enable byproducts
byproductChance = 40, -- Byproduct chance
byproductTrigger = "both", -- "success", "failure", "both"
-- Police alert system features
policeAlertSuccess = 30, -- Alert chance on success
policeAlertFailure = 70, -- Alert chance on failure
policeAlertType = "weapon_crafting", -- Alert type
policeAlertLocationType = "exact", -- "exact" or "randomized"
},
},
},
}
Recipe Properties
- amount: Number of items crafted
- time: Crafting duration in milliseconds
- anim: Custom animation (optional)
- expGain: Experience gained from crafting
- levelRequirement: Required skill level
- hideUntilLevel: Hide recipe until level requirement met
- successChance: Base success chance percentage
- skillBonus: Success chance bonus per skill level
- failureHandling: How to handle failed crafts
- hazards: Enable hazard system for this recipe
- byproducts: Enable byproduct system for this recipe
- policeAlertSuccess/Failure: Police alert chances
- policeAlertLocationType: "exact" or "randomized" location