Skip to content

Vehicle properties (tm.vehicleprops) ​

Context: client only.

Reads a vehicle's customization and condition into a plain table you can save as JSON or send over an event, and applies such a table back to a vehicle.

lua
local props = tm.vehicleprops.get(vehicle)        -- table, or nil when the entity is gone
local ok, reason = tm.vehicleprops.set(vehicle, props)

tm.vehicleprops.getProperties and setProperties are aliases of get and set.

set applies only the keys that are present, so a partial table such as { plate = 'TM 123' } is fine. It returns false and a reason when the vehicle does not exist, props is not a table, or this client does not own the networked vehicle (vehicle natives only take effect on the owner, so request control first).

Fields ​

The table holds only numbers, strings, booleans and nested plain tables. Key names follow the convention most FiveM garages already store, so existing saved vehicles stay readable.

GroupKeys
Identitymodel, plate (trimmed), plateIndex
ConditionbodyHealth, engineHealth, tankHealth, fuelLevel, oilLevel, dirtLevel (rounded to 0.1)
Paintcolor1, color2 (a color index, or { r, g, b } for custom paint), pearlescentColor, wheelColor, interiorColor, dashboardColor
LightsxenonColor, neonColor ({ r, g, b }), neonEnabled ({ left, right, front, back } booleans)
Glass and tireswindowTint, tyreSmokeColor ({ r, g, b }), bulletProofTyres
Wheelswheels (wheel type), modFrontWheels, modBackWheels, modCustomTiresF, modCustomTiresR
ModsmodSpoilers, modFrontBumper, modRearBumper, modSideSkirt, modExhaust, modFrame, modGrille, modHood, modFender, modRightFender, modRoof, modEngine, modBrakes, modTransmission, modHorns, modSuspension, modArmor, modPlateHolder, modVanityPlate, modTrimA, modOrnaments, modDashboard, modDial, modDoorSpeaker, modSeats, modSteeringWheel, modShifterLeavers, modAPlate, modSpeakers, modTrunk, modHydrolic, modEngineBlock, modAirFilter, modStruts, modArchCover, modAerials, modTrimB, modTank, modWindows, modDoorR, modLivery (each is a mod index, -1 for none)
Toggle modsmodTurbo, modSmokeEnabled, modXenon (booleans)
Liverylivery, roofLivery (-1 for none, not applied by set)
Extrasextras: { ["1"] = true, ["3"] = false }, only extras the model has, keyed by id as text so the table survives JSON. true means the extra is on.
Damagetyres, doors, windows: { ["2"] = true } for each burst tire, damaged door or broken window (empty tables when undamaged). set re-applies them.

Notes ​

  • fuelLevel reads the vehicle's fuel state bag when a fuel resource publishes one (a number), otherwise the native value. set updates the state bag too, but only when it already holds a number.
  • get calls SetVehicleModKit first because the game only reports mods once the kit is set.
  • set order matters and is handled for you: mod kit, wheel type, mods (wheels after their type), paint, appearance, condition, damage.
  • Do not send the table to the server unvalidated. Treat props that arrive from a client as untrusted data and check types and ranges before saving or broadcasting them.