# Configuration

{% tabs %}
{% tab title="QBCore" %}

```lua
Config = {}

--## Configuration starts here ##--
-----------------------------------
Config.EnablePoliceAlert = true     -- If true police will receive alerts if someone is starting to scrap 
Config.CustomAlert = function()
    exports['ps-dispatch']:SuspiciousActivity()
end

Config.Framework = "QBCore"             -- QBCore version of the script
Config.CoreResource = "qb-core"         -- Core resource name
Config.TargetSystem = "ox_target"       -- ox_target or qb-target
Config.Inventory = "qb"                 -- qb or ox
Config.InventoryResource = "qb-inventory" -- qb-inventory / other QBCore inventory resource name, or ox_inventory when Config.Inventory = "ox"

Config.MiniGame = true                  -- Enable/Disable true/false Mini Game
Config.PoliceAmount = 0                 -- Amount of needed Police to start Scrap - 0 for no Police or minimum 2
Config.PoliceJobs = {                   -- Jobs counted as police presence
    "police",
    "sheriff",
}

Config.Cooldown = {
    cooldown = true,                    -- Set Cooldown true/false if scrapping failed or was successfully
    cooldowntime = 5 * 60000,           -- Cooldown after successfully or failing scrapping (10*60000 = 5 Minutes)
}

Config.RewardSettings = {
    MinItems = 2,                       -- Get random 2 to 4 unique reward entries per successful scrap
    MaxItems = 4,
}

Config.Rewards = {                      -- Add as many items as you want
    [1] = {item="metalscrap", MinAmount= 12, MaxAmount=25},
    [2] = {item="iron", MinAmount= 12, MaxAmount=25},
    [3] = {item="steel", MinAmount= 12, MaxAmount=25},
    [4] = {item="plastic", MinAmount= 12, MaxAmount=25},
    [5] = {item="rubber", MinAmount= 12, MaxAmount=25},
}

Config.RobSettings = {
    item = "laser_cutter",              -- Item to Scrap Materials [REQUIRED / Add Item to your items.lua]
    removeitem = false,                 -- Removes Item after scrapping 
    scraptime = 10 * 1000,              -- Scrapping time (40*1000 = 40 Seconds)
}

Config.PartSettings = {
    OwnerOnlyPickup = true,            -- true = only the player who scrapped the wreck can loot the spawned parts, false = any nearby player can loot
    PickupDistance = 2.0,               -- Target interaction distance for spawned scrap parts
    ClaimDistance = 3.0,                -- Max allowed server-side pickup distance to prevent remote claiming
    SpawnRadius = 1.35,                 -- Base radius around the wreck for spawned parts
    MaxSpawnRadius = 2.35,              -- Max distance from wreck used by retry-based spawn validation
    MinDistanceFromWreck = 0.95,        -- Prevent parts from spawning inside the wreck collision
    SpawnHeight = 0.15,                 -- Base Z offset before the client grounds the object
    SpawnJitter = 0.22,                 -- Small variation so parts do not stack perfectly on top of each other
    SpawnAttempts = 8,                  -- Retry count per part if a position is blocked or invalid
    AttemptTimeout = 90 * 1000,         -- How long a started scrap attempt stays valid
    SessionTimeout = 10 * 60000,        -- How long spawned parts remain claimable
    PickupTime = 2500,                  -- Time to collect a single spawned part
    MarkerDistance = 20.0,              -- Draw marker range for spawned parts
    MarkerHeight = 0.45,                -- Marker offset above each spawned part
    MarkerScale = { x = 0.18, y = 0.18, z = 0.18 },
    MarkerColor = { r = 255, g = 170, b = 40, a = 180 },
}

Config.PartSpawnOverrides = {
    ["prop_rub_buswreck_01"] = { SpawnRadius = 2.35, MaxSpawnRadius = 3.35, MinDistanceFromWreck = 1.7 },
    ["prop_rub_buswreck_03"] = { SpawnRadius = 2.35, MaxSpawnRadius = 3.35, MinDistanceFromWreck = 1.7 },
    ["prop_rub_buswreck_06"] = { SpawnRadius = 2.35, MaxSpawnRadius = 3.35, MinDistanceFromWreck = 1.7 },
    ["prop_rub_trukwreck_1"] = { SpawnRadius = 2.15, MaxSpawnRadius = 3.05, MinDistanceFromWreck = 1.55 },
    ["prop_wrecked_buzzard"] = { SpawnRadius = 2.6, MaxSpawnRadius = 3.7, MinDistanceFromWreck = 1.9 },
    ["prop_rub_railwreck_1"] = { SpawnRadius = 2.6, MaxSpawnRadius = 3.8, MinDistanceFromWreck = 1.9 },
}

Config.ScrapSettings = {
    TargetDistance = 2.0,               -- Interact distance
    NumberOfCircles = 2,
    CircleMS = 10,
    from = 0,                           -- 0 AM 
    to = 23,                            -- 23 PM 
    policecallchance = 100,             -- 100% Police call chance from 0 AM - 23 PM
}

-- Add the items from Config.Rewards in here and set a object for each item
Config.ObjectParts = {
    ["metalscrap"] = {"imp_prop_impexp_exhaust_03", "imp_prop_impexp_exhaust_01", "imp_prop_impexp_exhaust_05", "imp_prop_impexp_radiator_03", 
    "imp_prop_impexp_radiator_04", "imp_prop_impexp_radiator_01", },
    ["iron"] = {"imp_prop_impexp_exhaust_03", "imp_prop_impexp_exhaust_01", "imp_prop_impexp_exhaust_05", "imp_prop_impexp_radiator_03", 
    "imp_prop_impexp_radiator_04", "imp_prop_impexp_radiator_01", },
    ["steel"] = {"imp_prop_impexp_exhaust_03", "imp_prop_impexp_exhaust_01", "imp_prop_impexp_exhaust_05", "imp_prop_impexp_radiator_03", 
    "imp_prop_impexp_radiator_04", "imp_prop_impexp_radiator_01", },
    ["plastic"] = {"ch_chint02_streetscables", "ch_prop_ch_unplugged_01a", "ch_chint02_cable_plugged_01", "ch_chint02_cable_plugged_02", 
    "xm3_int1_cables_01", "xm3_int1_cables_02", },
    ["rubber"] = {"prop_rub_tyre_dam3", "prop_rub_tyre_dam1", "prop_rub_tyre_dam2", 
    "xm3_int1_cables_01", "xm3_int1_cables_02", "xm3_int1_cables_03" },
}

Config.FallbackObjectParts = {
    "prop_rub_carpart_03",
    "prop_car_engine_01",
    "prop_rub_wreckage_3",
}

Config.ScrapParts = {
    "prop_rub_buswreck_01",
    "prop_rub_buswreck_03",
    "prop_rub_buswreck_06",
    "prop_rub_trukwreck_1",
    "prop_wrecked_buzzard",
    "prop_rub_carwreck_5",
    "prop_car_engine_01",
    "prop_rub_carpart_03",
    "prop_rub_railwreck_1",
    "prop_rub_carwreck_10",
    "prop_rub_carwreck_12",
    "prop_rub_carwreck_13",
    "prop_rub_carwreck_17",
    "prop_rub_carwreck_2",
    "prop_rub_carwreck_9",
    "prop_rub_carwreck_14",
    "prop_rub_carwreck_15",
    "prop_rub_carwreck_3",
    "prop_rub_carwreck_8",
    "prop_rub_carwreck_16",
    "prop_rub_carwreck_7",
    "prop_rub_carwreck_11",
    "prop_rub_bike_03",
    "prop_rub_t34",
    "prop_rub_bike_02",
    "prop_rub_bike_01",
    "prop_rub_chassis_02",
    "prop_rub_wreckage_9",
    "prop_rub_wreckage_3",
}

Config.Lang = {
    ["target_lable"] = "Scrap Wreck",
    ["pickup_label"] = "Collect part",
    ["item_need"] = "You need a laser cutter to scrap this",
    ["no_police"] = "Not enough police presence in the state",
    ["cooldown"] = "You recently collected scrap, you need to wait a while before trying again",
    ["police_alert"] = "ILLEGAL MATERIAL SCRAPPING",
    ["failed"] = "You failed! Evade and try again later",
    ["cancelled"] = "You stopped scrapping and left the wreck unfinished",
    ["hacksuccess"] = "Oh yeah! You've collected some parts of the wreck; here we go!",
    ["scrapping"] = "You are collecting debris...",
    ["pickuping"] = "Collecting part...",
    ["pickup_success"] = "You collected a scrap part",
    ["warning"] = "You no longer have the required tool",
    ["busy"] = "This wreck is already being stripped",
    ["already_scrapping"] = "You are already working on another wreck",
    ["session_expired"] = "The scrap parts are no longer available",
    ["invalid_scrap"] = "You cannot scrap this wreck right now",
    ["inventory_full"] = "You cannot carry that item right now",
    ["not_your_loot"] = "These scrap parts do not belong to you",
    ["notify_header"] = "Illegal Scrap",
    ["notify_subheader"] = "Info",
}

```

{% endtab %}

{% tab title="ESX" %}

```lua
Config = {}

--## Configuration starts here ##--
-----------------------------------
Config.EnablePoliceAlert = true     -- If true police will receive alerts if someone is starting to scrap 
Config.CustomAlert = function()
    exports['ps-dispatch']:SuspiciousActivity()
end

Config.MiniGame = true                  -- Enable/Disable true/false Mini Game
Config.PoliceAmount = 0                 -- Amount of needed Police to start Scrap - 0 for no Police or minimum 2
Config.PoliceJobs = {                   -- Only for ESX
    "police",
    "sheriff",
}

Config.Cooldown = {
    cooldown = true,                    -- Set Cooldown true/false if scrapping failed or was successfully
    cooldowntime = 5 * 60000,           -- Cooldown after successfully or failing scrapping (10*60000 = 5 Minutes)
}

Config.RewardSettings = {
    MinItems = 2,                       -- Get random 2 to 4 unique reward entries per successful scrap
    MaxItems = 4,
}

Config.Rewards = {                      -- Add as many items as you want
    [1] = {item="metalscrap", MinAmount= 12, MaxAmount=25},
    [2] = {item="iron", MinAmount= 12, MaxAmount=25},
    [3] = {item="steel", MinAmount= 12, MaxAmount=25},
    [4] = {item="plastic", MinAmount= 12, MaxAmount=25},
    [5] = {item="rubber", MinAmount= 12, MaxAmount=25},
}

Config.RobSettings = {
    item = "laser_cutter",              -- Item to Scrap Materials [REQUIRED / Add Item to your items.lua]
    removeitem = false,                 -- Removes Item after scrapping 
    scraptime = 10 * 1000,              -- Scrapping time (40*1000 = 40 Seconds)
}

Config.PartSettings = {
    OwnerOnlyPickup = true,            -- true = only the player who scrapped the wreck can loot the spawned parts, false = any nearby player can loot
    PickupDistance = 2.0,               -- ox_target interaction distance for spawned scrap parts
    ClaimDistance = 3.0,                -- Max allowed server-side pickup distance to prevent remote claiming
    SpawnRadius = 1.35,                 -- Base radius around the wreck for spawned parts
    MaxSpawnRadius = 2.35,              -- Max distance from wreck used by retry-based spawn validation
    MinDistanceFromWreck = 0.95,        -- Prevent parts from spawning inside the wreck collision
    SpawnHeight = 0.15,                 -- Base Z offset before the client grounds the object
    SpawnJitter = 0.22,                 -- Small variation so parts do not stack perfectly on top of each other
    SpawnAttempts = 8,                  -- Retry count per part if a position is blocked or invalid
    AttemptTimeout = 90 * 1000,         -- How long a started scrap attempt stays valid
    SessionTimeout = 10 * 60000,        -- How long spawned parts remain claimable
    PickupTime = 2500,                  -- Time to collect a single spawned part
    MarkerDistance = 20.0,              -- Draw marker range for spawned parts
    MarkerHeight = 0.45,                -- Marker offset above each spawned part
    MarkerScale = { x = 0.18, y = 0.18, z = 0.18 },
    MarkerColor = { r = 255, g = 170, b = 40, a = 180 },
}

Config.PartSpawnOverrides = {
    ["prop_rub_buswreck_01"] = { SpawnRadius = 2.35, MaxSpawnRadius = 3.35, MinDistanceFromWreck = 1.7 },
    ["prop_rub_buswreck_03"] = { SpawnRadius = 2.35, MaxSpawnRadius = 3.35, MinDistanceFromWreck = 1.7 },
    ["prop_rub_buswreck_06"] = { SpawnRadius = 2.35, MaxSpawnRadius = 3.35, MinDistanceFromWreck = 1.7 },
    ["prop_rub_trukwreck_1"] = { SpawnRadius = 2.15, MaxSpawnRadius = 3.05, MinDistanceFromWreck = 1.55 },
    ["prop_wrecked_buzzard"] = { SpawnRadius = 2.6, MaxSpawnRadius = 3.7, MinDistanceFromWreck = 1.9 },
    ["prop_rub_railwreck_1"] = { SpawnRadius = 2.6, MaxSpawnRadius = 3.8, MinDistanceFromWreck = 1.9 },
}

Config.ScrapSettings = {
    TargetDistance = 2.0,               -- Interact distance
    NumberOfCircles = 2,
    CircleMS = 10,
    from = 0,                           -- 0 AM 
    to = 23,                            -- 23 PM 
    policecallchance = 100,             -- 100% Police call chance from 0 AM - 23 PM
}


-- Add the items from Config.Rewards in here and set a object for each item
Config.ObjectParts = {
    ["metalscrap"] = {"imp_prop_impexp_exhaust_03", "imp_prop_impexp_exhaust_01", "imp_prop_impexp_exhaust_05", "imp_prop_impexp_radiator_03", 
    "imp_prop_impexp_radiator_04", "imp_prop_impexp_radiator_01", },
    ["iron"] = {"imp_prop_impexp_exhaust_03", "imp_prop_impexp_exhaust_01", "imp_prop_impexp_exhaust_05", "imp_prop_impexp_radiator_03", 
    "imp_prop_impexp_radiator_04", "imp_prop_impexp_radiator_01", },
    ["steel"] = {"imp_prop_impexp_exhaust_03", "imp_prop_impexp_exhaust_01", "imp_prop_impexp_exhaust_05", "imp_prop_impexp_radiator_03", 
    "imp_prop_impexp_radiator_04", "imp_prop_impexp_radiator_01", },
    ["plastic"] = {"ch_chint02_streetscables", "ch_prop_ch_unplugged_01a", "ch_chint02_cable_plugged_01", "ch_chint02_cable_plugged_02", 
    "xm3_int1_cables_01", "xm3_int1_cables_02", },
    ["rubber"] = {"prop_rub_tyre_dam3", "prop_rub_tyre_dam1", "prop_rub_tyre_dam2", 
    "xm3_int1_cables_01", "xm3_int1_cables_02", "xm3_int1_cables_03" },
}

Config.FallbackObjectParts = {
    "prop_rub_carpart_03",
    "prop_car_engine_01",
    "prop_rub_wreckage_3",
}

Config.ScrapParts = {
    "prop_rub_buswreck_01",
    "prop_rub_buswreck_03",
    "prop_rub_buswreck_06",
    "prop_rub_trukwreck_1",
    "prop_wrecked_buzzard",
    "prop_rub_carwreck_5",
    "prop_car_engine_01",
    "prop_rub_carpart_03",
    "prop_rub_railwreck_1",
    "prop_rub_carwreck_10",
    "prop_rub_carwreck_12",
    "prop_rub_carwreck_13",
    "prop_rub_carwreck_17",
    "prop_rub_carwreck_2",
    "prop_rub_carwreck_9",
    "prop_rub_carwreck_14",
    "prop_rub_carwreck_15",
    "prop_rub_carwreck_3",
    "prop_rub_carwreck_8",
    "prop_rub_carwreck_16",
    "prop_rub_carwreck_7",
    "prop_rub_carwreck_11",
    "prop_rub_bike_03",
    "prop_rub_t34",
    "prop_rub_bike_02",
    "prop_rub_bike_01",
    "prop_rub_chassis_02",
    "prop_rub_wreckage_9",
    "prop_rub_wreckage_3",
}

Config.Lang = {
    ["target_lable"] = "Scrap Wreck",
    ["pickup_label"] = "Collect part",
    ["item_need"] = "You need a laser cutter to scrap this",
    ["no_police"] = "Not enough police presence in the state",
    ["cooldown"] = "You recently collected scrap, you need to wait a while before trying again",
    ["police_alert"] = "ILLEGAL MATERIAL SCRAPPING",
    ["failed"] = "You failed! Evade and try again later",
    ["cancelled"] = "You stopped scrapping and left the wreck unfinished",
    ["hacksuccess"] = "Oh yeah! You've collected some parts of the wreck; here we go!",
    ["scrapping"] = "You are collecting debris...",
    ["pickuping"] = "Collecting part...",
    ["pickup_success"] = "You collected a scrap part",
    ["warning"] = "You no longer have the required tool",
    ["busy"] = "This wreck is already being stripped",
    ["already_scrapping"] = "You are already working on another wreck",
    ["session_expired"] = "The scrap parts are no longer available",
    ["invalid_scrap"] = "You cannot scrap this wreck right now",
    ["inventory_full"] = "You cannot carry that item right now",
    ["not_your_loot"] = "These scrap parts do not belong to you",
    ["notify_header"] = "Illegal Scrap",
    ["notify_subheader"] = "Info",
}

```

{% endtab %}
{% endtabs %}
