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.
| Group | Keys |
|---|---|
| Identity | model, plate (trimmed), plateIndex |
| Condition | bodyHealth, engineHealth, tankHealth, fuelLevel, oilLevel, dirtLevel (rounded to 0.1) |
| Paint | color1, color2 (a color index, or { r, g, b } for custom paint), pearlescentColor, wheelColor, interiorColor, dashboardColor |
| Lights | xenonColor, neonColor ({ r, g, b }), neonEnabled ({ left, right, front, back } booleans) |
| Glass and tires | windowTint, tyreSmokeColor ({ r, g, b }), bulletProofTyres |
| Wheels | wheels (wheel type), modFrontWheels, modBackWheels, modCustomTiresF, modCustomTiresR |
| Mods | modSpoilers, 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 mods | modTurbo, modSmokeEnabled, modXenon (booleans) |
| Livery | livery, roofLivery (-1 for none, not applied by set) |
| Extras | extras: { ["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. |
| Damage | tyres, doors, windows: { ["2"] = true } for each burst tire, damaged door or broken window (empty tables when undamaged). set re-applies them. |
Notes
fuelLevelreads the vehicle'sfuelstate bag when a fuel resource publishes one (a number), otherwise the native value.setupdates the state bag too, but only when it already holds a number.getcallsSetVehicleModKitfirst because the game only reports mods once the kit is set.setorder 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.