Tutorial 2026-05-25

FiveM Vehicle Tuning & Custom Shop Development

OntelMonke

OntelMonke

Developer at Agency Scripts

Vehicle Tuning in the Roleplay Context

Vehicle customization is one of the most popular features on any FiveM roleplay server. Players invest significant time and money into their cars, and a tuning shop gives them the ability to personalize their rides with performance upgrades, visual modifications, custom paint jobs, and aftermarket parts. A well-designed tuning system does more than expose GTA's built-in vehicle modification natives through a menu. It creates an entire ecosystem that includes player-operated mechanic shops, pricing structures that serve as economy sinks, installation timers that create realistic wait times, and a parts market where components can be sourced from different suppliers at varying quality levels. The tuning shop becomes a social hub where car enthusiasts gather, mechanics build their reputation, and every modified vehicle tells a story about its owner's taste and budget.

Understanding GTA Vehicle Modification Natives

GTA V exposes vehicle modifications through a series of native functions that let you apply upgrades to specific modification slots. Each vehicle has a set of mod types identified by numeric indices: engine upgrades use index 11, brakes use index 12, transmission uses index 13, suspension uses index 15, and visual parts like spoilers, bumpers, and skirts use indices 0 through 10. The SetVehicleMod native applies a specific modification from the available options for that vehicle model and mod type. Not every vehicle supports every modification category, so you need to check availability using GetNumVehicleMods before presenting options to the player. Paint jobs use separate natives like SetVehicleColours for primary and secondary colors, SetVehicleExtraColours for pearlescent and wheel colors, and SetVehicleCustomPrimaryColour for custom RGB values:

-- Mod type indices reference
local ModTypes = {
    spoiler = 0,
    front_bumper = 1,
    rear_bumper = 2,
    side_skirt = 3,
    exhaust = 4,
    frame = 5,
    grille = 6,
    hood = 7,
    fender = 8,
    right_fender = 9,
    roof = 10,
    engine = 11,
    brakes = 12,
    transmission = 13,
    horns = 14,
    suspension = 15,
    armor = 16,
    turbo = 18,
    xenon = 22,
    front_wheels = 23,
    back_wheels = 24,
    plate_holder = 25,
    vanity_plates = 26,
    trim = 27,
    ornaments = 28,
    dashboard = 29,
    dial = 30,
    door_speaker = 31,
    seats = 32,
    steering_wheel = 33,
    shifter_leavers = 34,
    plaques = 35,
    speakers = 36,
    trunk = 37,
    hydraulics = 38,
    engine_block = 39,
    air_filter = 40,
    struts = 41,
    arch_cover = 42,
    aerials = 43,
    trim2 = 44,
    tank = 45,
    windows = 46,
    livery = 48,
}

function GetAvailableMods(vehicle, modType)
    local count = GetNumVehicleMods(vehicle, modType)
    local mods = {}
    for i = 0, count - 1 do
        table.insert(mods, {
            index = i,
            label = GetModTextLabel(vehicle, modType, i) or ('Option ' .. (i + 1)),
        })
    end
    return mods
end

Tuning Shop Configuration

Configure tuning shop locations with their available services, pricing multipliers, and the modification categories they offer. Not every shop needs to offer every service. A high-end customs shop in Vinewood might specialize in luxury paint jobs and premium visual mods with higher prices but better quality. A street-level garage in South LS might focus on affordable performance parts and basic bodywork. This differentiation creates reasons for players to visit different shops and supports the roleplay identity of each business. Each shop needs a physical location with a vehicle entry point where the player drives their car inside, a camera position for the modification preview, and optionally an interior MLO for the garage environment:

Config.TuningShops = {
    ['benny_motorworks'] = {
        label = "Benny's Original Motor Works",
        coords = vector3(-205.67, -1312.58, 31.30),
        vehicleSpot = vector4(-211.89, -1320.88, 31.09, 178.94),
        camOffset = vector3(0.0, 5.5, 1.5),
        blipSprite = 72,
        categories = {'performance', 'visual', 'paint', 'wheels', 'lights', 'livery'},
        priceMultiplier = 1.0,
        restrictedTo = nil,  -- Open to all
    },
    ['ls_customs'] = {
        label = 'LS Customs - Burton',
        coords = vector3(-347.55, -133.00, 39.01),
        vehicleSpot = vector4(-339.20, -136.73, 39.01, 116.89),
        camOffset = vector3(0.0, 5.0, 1.5),
        blipSprite = 72,
        categories = {'performance', 'visual', 'paint', 'wheels'},
        priceMultiplier = 0.85,
        restrictedTo = nil,
    },
}

Config.ModPrices = {
    engine = {1500, 3500, 6000, 10000},       -- Level 1-4
    brakes = {1000, 2500, 4500, 7500},
    transmission = {1200, 3000, 5500, 9000},
    turbo = {15000},
    suspension = {800, 1500, 2500, 4000},
    armor = {2500, 5000, 10000, 17500, 25000},
    spoiler = 2000,       -- Flat price per option
    front_bumper = 1800,
    rear_bumper = 1500,
    side_skirt = 1200,
    exhaust = 1000,
    hood = 2500,
    roof = 1500,
    paint_standard = 500,
    paint_metallic = 1500,
    paint_custom_rgb = 5000,
    wheels = 3000,
    xenon = 3000,
    livery = 2500,
}

Real-Time Vehicle Preview System

Players need to see modifications on their vehicle before committing to a purchase. Implement a live preview system that temporarily applies selected modifications to the vehicle as the player browses options, then reverts all changes if the player cancels or only applies the purchased modifications. When the player enters the tuning menu, store the current vehicle properties as a snapshot. As they browse different options, apply each modification temporarily using the vehicle mod natives so the change is immediately visible. If the player selects a different option in the same category, revert the previous temporary mod before applying the new one. When the player confirms a purchase, the modification becomes permanent and is saved to the vehicle's database record. If they cancel, restore the vehicle to the saved snapshot state. Position the game camera to orbit around the vehicle during the preview, allowing the player to rotate the view and inspect modifications from every angle:

local originalMods = {}

function SaveVehicleSnapshot(vehicle)
    originalMods = QBCore.Functions.GetVehicleProperties(vehicle)
end

function PreviewMod(vehicle, modType, modIndex)
    SetVehicleMod(vehicle, modType, modIndex, false)
end

function RevertToSnapshot(vehicle)
    if originalMods then
        QBCore.Functions.SetVehicleProperties(vehicle, originalMods)
    end
end

function SetupTuningCamera(vehicle, shopConfig)
    local coords = GetEntityCoords(vehicle)
    local camCoords = coords + shopConfig.camOffset

    tuningCam = CreateCam('DEFAULT_SCRIPTED_CAMERA', true)
    SetCamCoord(tuningCam, camCoords.x, camCoords.y, camCoords.z)
    PointCamAtEntity(tuningCam, vehicle, 0.0, 0.0, 0.0, true)
    SetCamActive(tuningCam, true)
    RenderScriptCams(true, true, 1000, true, false)
end

Mechanic Job Integration

Transform the tuning shop from an automated menu into a player-driven business by integrating it with a mechanic job system. On-duty mechanics can perform vehicle modifications for customers, creating a service-oriented roleplay interaction. When a customer brings their vehicle to the shop, they can either use the self-service kiosk at a higher price or request a mechanic for a discounted rate. The mechanic sees incoming service requests on their tablet interface, accepts the job, discusses the desired modifications with the customer, and performs the work. During installation, play appropriate animations and particle effects to simulate the mechanic working on the vehicle. Add installation timers that vary based on the complexity of the modification, with engine swaps taking several minutes and paint jobs taking less time. Mechanics earn a commission on each job they complete, motivating them to provide good service and build a customer base. Track mechanic statistics like total jobs completed, customer satisfaction ratings, and specialization areas to create a progression system within the mechanic career.

Custom Paint and Wrap System

Go beyond the standard GTA color palette by implementing a custom paint system with RGB color pickers, metallic and matte finishes, pearlescent overlays, and custom wraps. The NUI color picker should display a full spectrum color wheel or HSL slider that lets players select any color imaginable. Apply the selected color using SetVehicleCustomPrimaryColour and SetVehicleCustomSecondaryColour with the RGB values from the picker. For wrap effects, use the vehicle livery system combined with custom texture replacement to apply patterns, carbon fiber textures, or branded designs to the vehicle body. Offer a two-tone paint option where the primary and secondary body panels can be different colors, creating distinctive color combinations. Save the exact RGB values to the vehicle database record so the custom colors persist across sessions and server restarts. Price custom paint jobs higher than standard colors to reflect the premium nature of the service and provide an effective money sink.

Performance Tuning and Dyno Testing

Performance modifications deserve more depth than simply selecting a menu option and having instant results. Implement a dyno testing feature where players can test their vehicle's performance stats before and after modifications. The dyno test simulates the vehicle running at full throttle and displays metrics like estimated horsepower, torque, top speed, and acceleration time. Use the game's vehicle handling data to calculate these values based on the installed modifications. Display the results in a clean NUI dashboard that compares before and after values with bar charts or numerical readouts. This gives players concrete feedback on how each upgrade affects their vehicle's performance, making the purchase decision more informed and satisfying. For an additional layer of realism, implement a tuning chip or ECU remap system where players can fine-tune parameters like throttle response, gear ratios, and brake balance through a slider interface, with changes reflected in the vehicle's actual handling characteristics using SetVehicleHandlingFloat natives.

Saving and Persisting Vehicle Modifications

Every modification applied to a player's vehicle must be saved to the database so it persists between sessions. Most FiveM frameworks store vehicle properties as a JSON blob in the player vehicles table. When a modification is applied and paid for, update the stored vehicle properties with the new mod values. When the vehicle is spawned from the garage, apply all saved modifications using the framework's SetVehicleProperties function. Handle edge cases like partial saves where the server crashes during a modification session, which could leave the vehicle in an inconsistent state. Use a transaction pattern where the payment is processed and the modification is saved in a single atomic database operation. If either step fails, roll back both to prevent the player from being charged without receiving the mod, or receiving a free modification. Log all modifications with timestamps and prices for admin review and to support potential rollbacks if exploits are discovered.

Illegal Modifications and Street Racing

Add a layer of criminal gameplay by implementing illegal modifications that are only available through underground tuning shops. Nitrous oxide injection provides a temporary speed boost that can overheat and damage the engine if used excessively. Engine swaps that exceed the legal horsepower limit make the vehicle subject to police inspection and impoundment if caught. Removed license plates, blacked-out windows beyond the legal tint percentage, and hydraulic suspension modifications all give police probable cause for a traffic stop. Track which modifications on a vehicle are classified as illegal and expose this information to police through a vehicle inspection mechanic. Officers can use a handheld scanner to check a vehicle's modification status, revealing illegal parts that warrant a citation or impoundment. This creates a cat-and-mouse dynamic between tuner culture and law enforcement that enriches the server's roleplay ecosystem.

Share this article

Ready to upgrade your server?

Check out our premium FiveM scripts in the Agency Scripts store or join our Discord community for support and updates.