> For the complete documentation index, see [llms.txt](https://patriot-studios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://patriot-studios.gitbook.io/docs/scripts/car-theft/advanced-config.md).

# Advanced Config

1.0.0

This is the default config.lua code for the most up to date version of the Patriot Car Theft: Advanced script. As part of the config file are code comments which explain the settings & allow you to customise the script how you see fit.

{% hint style="warning" %}
For the contract thumbnails you will need to use a HTTP file address. So you can either just grab images off the internet or use your own images by posting them to a website where you can retrieve the address. The pre-made contracts use [**Postimages**](https://postimages.org/) for their thumbnails, so feel free to do the same!
{% endhint %}

{% hint style="info" %}
If you want to create your own custom contracts, you can easily do so by just copying a current contract & by pasting it into the Config.Contracts table!&#x20;
{% endhint %}

```lua
Config = {}

-- Visual Settings
Config.MenuColor = "#D12DFF" -- Primary theme color (Must be a Hex code)

Config.MissionHUD =
{
    Enabled  = true, -- Set to false to completely disable the on-screen Mission HUD
    Position = -- CSS positioning values (adjust if it overlaps your server's HUD)
    {
        top    = "50%",  -- Vertical position (e.g., "50%", "30px", "auto")
        left   = "30px", -- Horizontal position (e.g., "30px", "auto")
        bottom = "auto", -- Use "auto" to ignore, or a value like "30px"
        right  = "auto", -- Use "auto" to ignore, or a value like "30px"
    }
}

Config.MissionManagementKey = "F10" -- Default key to open the mission management tablet (rebindable in FiveM settings)

-- Framework Detection
Config.Framework = 'auto' -- 'auto' = Automatically detects at startup
-- Manual override: 'standalone', 'esx', 'qbcore', 'qbox'

Config.MoneyAccount = 'cash' -- The account to deposit payout into.
-- Common values: 'cash', 'bank', 'black_money' (ESX dirty money),
-- 'crypto' (QBCore), or any custom account your framework supports.
-- Standalone mode: This setting is ignored (rewards are logged only).

-- Developer Settings
Config.Debug = false -- Set to true during development to enable structured server/client logging.
-- Keep false on live/production servers to avoid console noise.

-- Progression & Rewards
Config.MinVehicleHealth = 70   -- %: Below this, mission fails on delivery

Config.CleanBonusPercent = 100  -- %: Adds this fraction to payout when target vehicle is not damaged at all
Config.CleanBonusMinHealthPercent = 99.5 -- At or above this delivery condition % counts as clean bonus 

-- Police Requirements
Config.PoliceRequiredForContracts = false -- If enabled, players cannot start any contracts unless the required number of police are online.
Config.MinPoliceForContracts = 1 -- That amount of police that must be online before players can start contracts

-- Police Alert Settings
Config.Police =
{
    AlertChance = 100, -- % chance of a police alert on unlock (0 = disabled, 100 = always)
    AlertOnStart = false, -- Alert when hacking starts
    AlertOnSuccess = true, -- Alert when car is successfully unlocked

    -- Framework mode: Alerts are sent to players with any of these job names.
    -- Add as many as your server needs (e.g., "sheriff", "bcso", "sasp").
    Jobs = { "police" },

    -- Standalone mode: Uses ace permissions instead of job checks.
    PolicePerm = "police.alert", -- Grant with: add_ace group.police police.alert allow

    -- Blip timeouts (in milliseconds)
    GpsLostBlipTimeout = 60000, -- How long the "GPS SIGNAL LOST" blip stays (default: 60 seconds)
    TheftBlipTimeout = 30000,   -- How long the "Theft in Progress" blip stays (default: 30 seconds)

    -- Dispatch mode: "integrated" uses built-in UI notifications, "external" triggers event for custom dispatch systems
    DispatchMode = "integrated"
}

-- NPC Configuration
Config.NPC =
{
    model = "u_m_m_edtoh",
    RotateLocation = false, -- If set true it will enable rotating locations, where the NPC will move to one of the Locations randomly every Rotate Interval
    RotateInterval = 1,     -- Minutes between moves

    Locations =
    {
        {
            label = "Legion",
            npcSpawnCoords = vector4(72.9042, -870.7901, 30.5276, 67.5671),
            startVehicleCoords = vector4(67.9218, -867.4046, 30.5655, 158.1543)
        },
        {
            label = "Hayes Auto",
            npcSpawnCoords = vector4(473.9584, -1310.7128, 29.2255, 208.3332),
            startVehicleCoords = vector4(495.8452, -1328.2910, 29.3398, 16.5635)
        },
        {
            label = "Del Perrio Pier",
            npcSpawnCoords = vector4(-1841.8350, -1209.7886, 13.0172, 195.8877),
            startVehicleCoords = vector4(-1843.4844, -1225.7928, 13.0172, 294.3299)
        }
    }
}

-- Start Vehicle (Spawns for players when a contract starts)
Config.StartVehicle =
{
    model = "manchez",
    VehicleType = "bike", -- vehicles.meta class (Helps determine how many vehicles need to be spawnt)
    SpawnEscortAtLeader = false, -- If true, start vehicle spawns beside the leader (helps distant members stream the bike). If false, uses active NPC location startVehicleCoords.
    ForceWarp = false, -- If true, pulls player out of their current vehicle
    Spacing = 3.0,     -- Meters between vehicles if multiple are spawnt
    Seats = 2,         -- Minimum seats per a start vehicle; combined with model detection (max) so bikes aren’t treated as 1-seat only
}

-- Mission Contracts
Config.Contracts =
{
    {
        id = 1,
        title = "Pizza rivals",
        description =
        "You have been hired by a Pizza This rival. Head to the Pizza This store located in Downtown Vinewood & steal their red faggio.",
        difficulty = "easy",
        thumbnail = "https://i.postimg.cc/Fsx7wjyT/image.png", -- Must use HTTP URL
        vehicle = "faggio",
        primaryColor = 27,
        secondaryColor = 0,
        reward = 2000,
        requirePerfect = false, -- If true then target vehicle must NOT be damaged or else players fail the contract
        gpsTracker = false,
        estimatedTime = "3.5 mins",
        spawnCoords = vector4(535.9539, 95.3780, 95.8023, 91.0724), -- Target vehicle's spawn coords
        deliveryCoords = vector4(-199.3892, -1380.7524, 31.2582, 221.2730)
    },
    {
        id = 2,
        title = "Criminals Acquire",
        description =
        "A criminal group needs to acquire a truck to use for their activities. Your job is to locate a white custom mule truck parked at The Secure Unit Storage Facility located in La Mesa & deliver the back of a shop near Vespucci Beach.",
        difficulty = "easy",
        thumbnail = "https://i.postimg.cc/mDBTRnyT/image.png",
        vehicle = "mule4",
        primaryColor = 111,
        secondaryColor = 0,
        reward = 4000,
        requirePerfect = false,
        gpsTracker = false,
        estimatedTime = "5 mins",
        spawnCoords = vector4(851.5363, -1227.0651, 26.2116, 270.6587),
        deliveryCoords = vector4(-2964.1589, 61.0017, 11.6085, 13.5326)
    },
    {
        id = 3,
        title = "The Trust Fund Retrieval",
        description =
        "An international student has lost his blue Flash GT to some Ballas & doesn't want his parents to find out. Head to Grove Street to retrieve it & deliver it to The Von Crastenburg Hotel.",
        difficulty = "moderate",
        thumbnail = "https://i.postimg.cc/4dg385Lc/image.png",
        vehicle = "flashgt",
        primaryColor = 64,
        secondaryColor = 0,
        reward = 6000,
        requirePerfect = false,
        gpsTracker = false,
        estimatedTime = "4 mins",
        spawnCoords = vector4(115.2977, -1948.8735, 20.4602, 51.0947),
        deliveryCoords = vector4(-1882.2570, -307.2971, 49.2394, 62.3308)
    },
    {
        id = 4,
        title = "Showroom Sabotage | Part 1",
        description =
        "The owner of PDM wants you to steal vehicles from Luxury Autos. Head to Luxury Autos & retrieve a frost white Dubsta. Bring it back to the PDM dealership, so he can out compete them.",
        difficulty = "moderate",
        thumbnail = "https://i.postimg.cc/R0cCyDDX/image.png",
        vehicle = "dubsta2",
        primaryColor = 112,
        secondaryColor = 0,
        reward = 8000,
        requirePerfect = false,
        gpsTracker = true,
        estimatedTime = "3 mins",
        spawnCoords = vector4(-736.9371, -266.4202, 36.9437, 29.6988),
        deliveryCoords = vector4(-12.5174, -1083.8098, 26.6721, 69.9045)
    },
    {
        id = 5,
        title = "Showroom Sabotage | Part 2",
        description =
        "The owner of PDM wants you to steal vehicles from Luxury Autos. Head to Luxury Autos & retrieve a midnight purple Italirsx. Bring it back to the PDM dealership, so he can out compete them.",
        difficulty = "moderate",
        thumbnail = "https://i.postimg.cc/YS8jnPVv/image.png",
        vehicle = "italirsx",
        primaryColor = 142,
        secondaryColor = 11,
        reward = 8000,
        requirePerfect = false,
        gpsTracker = true,
        estimatedTime = "2.5 mins",
        spawnCoords = vector4(-736.9371, -266.4202, 36.9437, 29.6988),
        deliveryCoords = vector4(-12.5174, -1083.8098, 26.6721, 69.9045)
    },
    {
        id = 6,
        title = "For The Wife",
        description =
        "The owner of PDM wants you to retrieve a hot pink Baller LE LWB. It should be located near Luxury Autos. DO NOT GET IT DAMAGED!",
        difficulty = "moderate",
        thumbnail = "https://i.postimg.cc/6qxrwg9F/image.png",
        vehicle = "baller4",
        primaryColor = 135,
        secondaryColor = 0,
        reward = 10000,
        requirePerfect = true,
        gpsTracker = true,
        estimatedTime = "3 mins",
        spawnCoords = vector4(-736.9371, -266.4202, 36.9437, 29.6988),
        deliveryCoords = vector4(-12.5174, -1083.8098, 26.6721, 69.9045)
    },
    {
        id = 7,
        title = "Party Time!",
        description =
        "A lady is paying you to acquire a Festival Bus to turn this city into one huge ass party! Luckily there is one parked out front of Bahama Mamas located in Del Perro. Head down there, retrieve it & take it to Legion Square!",
        difficulty = "hard",
        thumbnail = "https://i.postimg.cc/KYGQHJxT/image.png",
        vehicle = "pbus2",
        primaryColor = 0,
        secondaryColor = 0,
        reward = 9000,
        requirePerfect = false,
        gpsTracker = true,
        estimatedTime = "5 mins",
        spawnCoords = vector4(-1407.6113, -587.5410, 30.6512, 297.8530),
        deliveryCoords = vector4(229.8840, -838.5757, 30.2102, 245.4220)
    },
    {
        id = 8,
        title = "Armored Car Smuggle",
        description =
        "A foreign buyer wants you to acquire a black Armored Cognoscenti 55, which belongs to an enemy state's diplomat. Head to the Rockford Hills area & retrieve the vehicle. Once done, deliver it to the docks.",
        difficulty = "hard",
        thumbnail = "https://i.postimg.cc/FHbjmNzM/image.png",
        vehicle = "cog552",
        primaryColor = 0,
        secondaryColor = 0,
        reward = 10000,
        requirePerfect = false,
        gpsTracker = true,
        estimatedTime = "7 mins",
        spawnCoords = vector4(-910.8361, 190.3266, 68.9598, 178.5274),
        deliveryCoords = vector4(1169.8354, -2973.8762, 5.9021, 95.7364)
    },
    {
        id = 9,
        title = "Foreign Espionage",
        description =
        "A foreign buyer has instructed you to steal a black Terrorbyte owned by The International Affairs Agency (IAA) that is located under their HQ. Once acquired, you are to take it to a hangar located at the LSIA, without getting the vehicle damaged.",
        difficulty = "hard",
        thumbnail = "https://i.postimg.cc/6p30XzyP/image.png", 
        vehicle = "terbyte",
        primaryColor = 0,
        secondaryColor = 0,
        reward = 15000,
        requirePerfect = true,
        gpsTracker = true,
        estimatedTime = "10 mins",
        spawnCoords = vector4(120.6465, -725.8553, 33.1332, 250.7061),
        deliveryCoords = vector4(-1274.6150, -3386.2188, 13.9402, 318.9987)
    },
    {
        id = 10,
        title = "A Manager's Last Chance",
        description =
            "A manager from Escalera Rent-A-Car has contacted you to retrieve an orange Deveste, stating that if he doesn't get it back then he will lose his job."
            ..
            " Head down to The Diamond Casino to get it & once done deliver it to the Escalera Rent-A-Car Parking Lot at LSIA, without getting the vehicle damaged.",
        difficulty = "hard",
        thumbnail = "https://i.postimg.cc/DZLrfMQZ/image.png",
        vehicle = "deveste",
        primaryColor = 38,
        secondaryColor = 0,
        reward = 10000,
        requirePerfect = true,
        gpsTracker = true,
        estimatedTime = "5 mins",
        spawnCoords = vector4(976.1309, 7.5687, 80.3674, 147.0351),
        deliveryCoords = vector4(-901.4249, -2334.2419, 6.7090, 327.3960)
    },
    {
        id = 11,
        title = "THE PATRIOT",
        description =
            "An old man has tasked you with the job of retrieving an American Flag Painted Monster Truck. Stating that it was stolen from him by big gov. He needs it back to revive America!"
            .. " Get the monster truck & deliver it to the Sandy Shore Airfield.",
        difficulty = "extreme",
        thumbnail = "https://i.postimg.cc/WzkF2FMc/image.png",
        vehicle = "monster",
        reward = 20000,
        requirePerfect = false,
        gpsTracker = true,
        estimatedTime = "5.5 mins",
        spawnCoords = vector4(409.9953, -1638.1438, 29.3963, 319.3183),
        deliveryCoords = vector4(1749.0061, 3281.1289, 41.0824, 232.5036)
    },
    {
        id = 12,
        title = "NERD ALERT!",
        description =
            "Some nerd had his Space Docker taken & says NOOSE confiscated it due to it being from a foreign planet."
            ..
            " Your task is to head to Humane Labs & get it back. Once retrieved - drive it back to the nerd's garage. DO NOT DAMAGE IT!",
        difficulty = "extreme",
        thumbnail = "https://i.postimg.cc/BQ1Hs63n/image.png",
        vehicle = "dune2",
        reward = 25000,
        requirePerfect = true,
        gpsTracker = true,
        estimatedTime = "13 mins",
        spawnCoords = vector4(3614.3975, 3740.9192, 28.1516, 233.6984),
        deliveryCoords = vector4(-25.2492, -1427.3541, 30.6553, 174.2658)
    }
}

-- Mission Timers (in milliseconds) (Used for when minigames are disabled)
Config.DecryptTime = 5000  -- 5 seconds to hack the car
Config.TrackerRemovalTime = 10000 -- 10 seconds to rip out the GPS
Config.SearchRadius = 150.0 -- Meters: The size of the approximate search area

-- Distance from target spawn at which clients begin aggressively streaming/collision-loading the vehicle.
-- Larger = vehicle tends to appear settled before the player reaches the search zone (default was ~300 in script).
Config.TargetVehicleStreamDistance = 520.0

-- Mission Blips
Config.Blips =
{
    FallbackColor = nil, -- nil = use index 3 (blue); set a number 0–85 to force a default when hex is invalid
    MissionSprite = 225, -- Sprite for search area
    DeliverySprite = 50, -- Sprite for delivery drop-off
}

-- Minigames
Config.UseUnlockMinigame = true -- If false, uses DecryptTime timer instead of minigame
Config.UseGPSMinigame = true -- If false, uses TrackerRemovalTime timer instead of minigame
Config.MaxFailuresBeforePolice = 2 -- 0 = Police called on 1st fail, 2 = 3rd fail calls police, etc

Config.DifficultySettings =
{
    ['easy'] = {
        hackingSpeed = 1000, -- Higher is slower/easier
        wireCount    = 3,    -- 3 wires to connect
        policeChance = 25,   -- % chance that police receive an alert once target vehicle is unlocked
    },
    ['moderate'] = {
        hackingSpeed = 750,
        wireCount    = 4,
        policeChance = 50,
    },
    ['hard'] = {
        hackingSpeed = 500,
        wireCount    = 5,
        policeChance = 75,
    },
    ['extreme'] = {
        hackingSpeed = 500,
        wireCount    = 4,
        policeChance = 100,
    }
}

-- Co-Op Settings
Config.CoOp =
{
    Enabled = true,
    MaxCrewSize = 4, -- Max players in one crew (including leader)
    InviteTimeout = 30, -- Seconds before an unanswered invite auto-expires
    InviteRadius = 30.0, -- Meters: How close a player must be to the NPC to appear as invitable
    SplitReward = true, -- if false each crew member earns the full payout, if true payout is split equally
}

```
