Browse docs
QBCore Vehicle Properties
Use this page for QBCore 1.3.0. You can find your version in
qb-core/fxmanifest.lua, on the line that starts with version.
Your garage and Mechanic keep using the normal QBCore vehicle functions. This page is for QBCore. Qbox owners use the ox_lib instructions.
1. Open the file
- Stop the server and make a backup of the file below, outside the server's resources folder.
- Open
qb-core/client/functions.luain your host's file editor or your usual code editor. - Keep that file open for every step on this page.
How to use each step: press Ctrl+F to find the first line of the Find block. Select the entire shown block in your file, then paste the complete Replace with block over it. Leave the surrounding code in place. You do not need to understand or rewrite the code.
If the Replace with block is already there, skip that step. If neither block matches, stop editing and restore your backup before starting the server. Send the file and your version to support. Versions and edited files can differ; do not guess where to paste.
2. Save extras correctly
Inside QBCore.Functions.GetVehicleProperties:
Find:
for extraId = 0, 12 do
if DoesExtraExist(vehicle, extraId) then
local state = IsVehicleExtraTurnedOn(vehicle, extraId) == 1
extras[tostring(extraId)] = state
end
end
local modLivery = GetVehicleMod(vehicle, 48)
if GetVehicleMod(vehicle, 48) == -1 and GetVehicleLivery(vehicle) ~= 0 then
modLivery = GetVehicleLivery(vehicle)
end
Replace with:
for extraId = 0, 12 do
if DoesExtraExist(vehicle, extraId) then
local state = IsVehicleExtraTurnedOn(vehicle, extraId)
extras[tostring(extraId)] = state
end
end
3. Save tyre protection and paint finishes
Inside QBCore.Functions.GetVehicleProperties:
Find:
plateIndex = GetVehicleNumberPlateTextIndex(vehicle),
bodyHealth = QBCore.Shared.Round(GetVehicleBodyHealth(vehicle), 0.1),
engineHealth = QBCore.Shared.Round(GetVehicleEngineHealth(vehicle), 0.1),
tankHealth = QBCore.Shared.Round(GetVehiclePetrolTankHealth(vehicle), 0.1),
fuelLevel = QBCore.Shared.Round(GetVehicleFuelLevel(vehicle), 0.1),
dirtLevel = QBCore.Shared.Round(GetVehicleDirtLevel(vehicle), 0.1),
oilLevel = QBCore.Shared.Round(GetVehicleOilLevel(vehicle), 0.1),
color1 = colorPrimary,
Replace with:
plateIndex = GetVehicleNumberPlateTextIndex(vehicle),
tyresCanBurst = GetVehicleTyresCanBurst(vehicle),
bodyHealth = QBCore.Shared.Round(GetVehicleBodyHealth(vehicle), 0.1),
engineHealth = QBCore.Shared.Round(GetVehicleEngineHealth(vehicle), 0.1),
tankHealth = QBCore.Shared.Round(GetVehiclePetrolTankHealth(vehicle), 0.1),
fuelLevel = QBCore.Shared.Round(GetVehicleFuelLevel(vehicle), 0.1),
dirtLevel = QBCore.Shared.Round(GetVehicleDirtLevel(vehicle), 0.1),
oilLevel = QBCore.Shared.Round(GetVehicleOilLevel(vehicle), 0.1),
paintType1 = GetVehicleModColor_1(vehicle),
paintType2 = GetVehicleModColor_2(vehicle),
color1 = colorPrimary,
4. Save both types of livery
Inside QBCore.Functions.GetVehicleProperties:
Find:
modLivery = modLivery,
Replace with:
modLivery = GetVehicleMod(vehicle, 48),
livery = GetVehicleLivery(vehicle),
5. Restore tyre protection
Inside QBCore.Functions.SetVehicleProperties:
Find:
SetVehicleModKit(vehicle, 0)
Replace with:
SetVehicleModKit(vehicle, 0)
if props.tyresCanBurst ~= nil then SetVehicleTyresCanBurst(vehicle, props.tyresCanBurst) end
6. Restore colours and the paint finish
Inside QBCore.Functions.SetVehicleProperties:
Find:
if props.color1 then
if type(props.color1) == 'number' then
ClearVehicleCustomPrimaryColour(vehicle)
SetVehicleColours(vehicle, props.color1, colorSecondary)
else
SetVehicleCustomPrimaryColour(vehicle, props.color1[1], props.color1[2], props.color1[3])
end
end
if props.color2 then
if type(props.color2) == 'number' then
ClearVehicleCustomSecondaryColour(vehicle)
SetVehicleColours(vehicle, props.color1 or colorPrimary, props.color2)
else
SetVehicleCustomSecondaryColour(vehicle, props.color2[1], props.color2[2], props.color2[3])
end
end
Replace with:
-- Preserve paint finishes, palette resets and mixed RGB/palette colours.
local primaryIndex = type(props.color1) == 'number' and props.color1 or colorPrimary
local secondaryIndex = type(props.color2) == 'number' and props.color2 or colorSecondary
if props.paintType1 ~= nil then
SetVehicleModColor_1(vehicle, props.paintType1, primaryIndex, props.pearlescentColor or pearlescentColor)
end
if props.paintType2 ~= nil then
SetVehicleModColor_2(vehicle, props.paintType2, secondaryIndex)
end
if type(props.color1) == 'number' or type(props.color2) == 'number' then
SetVehicleColours(vehicle, primaryIndex, secondaryIndex)
end
if props.color1 ~= nil then
if type(props.color1) == 'table' then
SetVehicleCustomPrimaryColour(vehicle, props.color1[1], props.color1[2], props.color1[3])
else
ClearVehicleCustomPrimaryColour(vehicle)
end
end
if props.color2 ~= nil then
if type(props.color2) == 'table' then
SetVehicleCustomSecondaryColour(vehicle, props.color2[1], props.color2[2], props.color2[3])
else
ClearVehicleCustomSecondaryColour(vehicle)
end
end
7. Allow the turbo to be switched off
Inside QBCore.Functions.SetVehicleProperties:
Find:
if props.modTurbo then
ToggleVehicleMod(vehicle, 18, props.modTurbo)
end
Replace with:
if props.modTurbo ~= nil then
ToggleVehicleMod(vehicle, 18, props.modTurbo)
end
8. Allow tyre smoke to be switched off
Inside QBCore.Functions.SetVehicleProperties:
Find:
if props.modSmokeEnabled then
ToggleVehicleMod(vehicle, 20, props.modSmokeEnabled)
end
Replace with:
if props.modSmokeEnabled ~= nil then
ToggleVehicleMod(vehicle, 20, props.modSmokeEnabled)
end
9. Restore headlights and their colours
Inside QBCore.Functions.SetVehicleProperties:
Find:
if props.modXenon then
ToggleVehicleMod(vehicle, 22, props.modXenon)
end
if props.xenonColor then
if type(props.xenonColor) == 'table' then
SetVehicleXenonLightsCustomColor(vehicle, props.xenonColor[1], props.xenonColor[2], props.xenonColor[3])
else
SetVehicleXenonLightsColor(vehicle, props.xenonColor)
end
end
Replace with:
if props.modXenon ~= nil then
ToggleVehicleMod(vehicle, 22, props.modXenon)
end
if props.xenonColor ~= nil then
if type(props.xenonColor) == 'table' then
SetVehicleXenonLightsCustomColor(vehicle, props.xenonColor[1], props.xenonColor[2], props.xenonColor[3])
else
ClearVehicleXenonLightsCustomColor(vehicle)
SetVehicleXenonLightsColor(vehicle, props.xenonColor)
end
end
if props.customXenonColor ~= nil then
SetVehicleXenonLightsCustomColor(vehicle, props.customXenonColor[1], props.customXenonColor[2], props.customXenonColor[3])
end
10. Restore both types of livery
Inside QBCore.Functions.SetVehicleProperties:
Find:
if props.modLivery then
SetVehicleMod(vehicle, 48, props.modLivery, false)
SetVehicleLivery(vehicle, props.modLivery)
end
Replace with:
if props.modLivery ~= nil then
SetVehicleMod(vehicle, 48, props.modLivery, false)
if props.livery == nil then SetVehicleLivery(vehicle, props.modLivery) end
end
if props.livery ~= nil then
SetVehicleLivery(vehicle, props.livery)
end
11. Save and finish
Save the file. If you edited a downloaded copy, upload it back to the same location on the server. Then return to Garage Integration for the MSK notes and the vehicle test.
Your existing vehicle functions now include the changes above. Keep the framework's normal get/set calls in other scripts. Do not copy Sky function bodies into framework core files.
Reference version
The Find blocks were checked against the unmodified official repository on 11 September 2026:
QBCore 1.3.0, source 9b3cddcc.
The examples are not based on a customized server installation.