RX Scripts Logo
Chopshop

Configurables

All config & open sourced files included within this script.

Config Files

--[[
BY RX Scripts © rxscripts.xyz
--]]

Config.Locale = 'en'

Config.RequiredItem = { item = 'phone', label = 'Phone', removeAfterStartScrap = false } -- Remove line to disable
Config.TableModel = 'prop_tablesaw_01'
Config.ScrappingCooldown = 3600 -- Cooldown in seconds that a player has to wait before scrapping another vehicle
Config.WeldingTime = 2000 -- In ms
Config.DeleteVehiclesFromDB = false -- Delete owned vehicles from database when scrapped?

Config.SpawnVehicleAtStart = {
    enabled = false, -- Spawn vehicle at start of scrapping?,
    coords = vector4(-442.5281, -1670.0328, 19.0291, 126.4909),
    models = { -- Models where a random model gets picked from
        'adder'
    }
}

Config.Suspicion = {
    enabled = true,
    mistakesBeforeNotifyingPolice = 3,
    cancelOnSuspiciousReason = true,
    suspiciousReasonWords = {
        'stolen',
        'steal',
        'stole',
        'heist',
    }
}

Config.RequiredJobs = {
    enabled = false, -- Do you want to players to need a job to scrap vehicles?
    jobs = {
        'mechanic',
        'police',
    }
}

Config.PartReturns = { -- Items you get from scrapping parts
    trunk = {
        { item = 'scrapmetal', amount = 10 },
        { item = 'copper', amount = 3 },
    },
    hood = {
        { item = 'scrapmetal', amount = 10 },
        { item = 'copper', amount = 3 },
    },
    doorFrontRight = {
        { item = 'scrapmetal', amount = 5 },
        { item = 'copper', amount = 2 },
    },
    doorFrontLeft = {
        { item = 'scrapmetal', amount = 5 },
        { item = 'copper', amount = 2 },
    },
    doorRearRight = {
        { item = 'scrapmetal', amount = 5 },
        { item = 'copper', amount = 2 },
    },
    doorRearLeft = {
        { item = 'scrapmetal', amount = 5 },
        { item = 'copper', amount = 2 },
    },
    wheelFrontRight = {
        { item = 'scrapmetal', amount = 5 },
        { item = 'rubber', amount = 5 },
    },
    wheelFrontLeft = {
        { item = 'scrapmetal', amount = 4 },
        { item = 'rubber', amount = 5 },
    },
    wheelRearRight = {
        { item = 'scrapmetal', amount = 4 },
        { item = 'rubber', amount = 5 },
    },
    wheelRearLeft = {
        { item = 'scrapmetal', amount = 4 },
        { item = 'rubber', amount = 5 },
    },
}

Config.Scrapyards = {
    {
        vehicleCoords = vector3(-426.5357, -1688.9329, 19.0291),
        tableCoords = vector3(-428.3014, -1681.5248, 19.0291),
        onlyPlayerNotOwnedCars = true, -- Only allow scrapping of cars that are not owned by a player
        npc = {
            label = 'Scrapyard Worker',
            model = 's_m_m_autoshop_02',
            coords = vector4(-425.5182, -1679.4059, 18.0291, 198.2127),
        },
        blip = {
            enabled = true,
            sprite = 446,
            color = 5,
            scale = 0.8,
            display = 4,
            label = 'Scrapyard',
        },
        blacklistedVehicles = {
            'adder',
        },
    }
}

Opensource Files

All script-related open source code is contained within these files. Third-party components, including frameworks, inventory systems, and other external code, are separately maintained & open sourced in our fmLib repository.
--[[
BY RX Scripts © rxscripts.xyz
--]]

-- return true if minigame has been succeeded, false if not
function ScrapMinigame()
    return lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
end

function Notify(msg, type)
    if Core == 'ESX' then
        CoreObj.ShowNotification(msg, type)
    elseif Core == 'QB' then
        CoreObj.Functions.Notify(msg, type)
    end
end

function Marker(coords)
    DrawMarker(1, coords.x, coords.y, coords.z, 0, 0, 0, 0, 0, 0, 3.0, 3.0, 0.5, 255, 255, 0, 80, false, true, 2, false, false, false, false)
end

function GetJob()
    if ESX then
        return ESX.GetPlayerData().job
    elseif QB then
        return QB.Functions.GetPlayerData().job
    else
        -- Your own job system
    end
end