Servicing
Configure how vehicle parts wear and when they need servicing
JG Mechanic tracks the health of each serviceable part as a vehicle gains mileage. Worn parts gradually affect the vehicle's handling. A mechanic can inspect and replace them through the Servicing app on the tablet.
Servicing supports cars, motorbikes and quad bikes. Part health is saved with the vehicle, so it continues from the same point after a restart.
Enable or disable servicing
The main servicing settings are in config/config.lua.
Set Config.EnableVehicleServicing to false to stop servicing wear for every vehicle:
Config.EnableVehicleServicing = falseTo keep servicing enabled but exclude certain vehicles, add their spawn codes to Config.ServicingBlacklist:
Config.ServicingBlacklist = {
"police",
"police2"
}Set the service interval
Two settings decide when a vehicle needs servicing:
lifespanInKminconfig/config.servicing.luacontrols how fast each part wears. A part withlifespanInKm = 500drops from100%to0%over 500 km. Increase this value for a longer interval, or decrease it for a shorter interval.Config.ServiceRequiredThresholdinconfig/config.luacontrols when the vehicle is flagged as needing a service. A higher percentage flags it sooner. A lower percentage lets the part wear further before it is due.
For example, a part with a lifespan of 500 km and a service threshold of 20% will be due after roughly 400 km:
lifespanInKm = 500Config.ServiceRequiredThreshold = 20The threshold only decides when the warning appears. It doesn't change how fast the part wears or how wear affects the vehicle.
Changing an interval doesn't reset a vehicle's current part health. The new wear rate is used as the vehicle gains more mileage. Replacing a part through the tablet returns that part to 100%.
Configure each part
Edit the existing parts in Config.Servicing in config/config.servicing.lua:
| Option | What it does |
|---|---|
lifespanInKm | Distance in kilometres for the part to wear from 100% to 0% |
itemName | Inventory item used when a mechanic replaces the part |
itemQuantity | Number of items used when the part is replaced |
restricted | Limits the part to "combustion" or "electric" vehicles |
Make sure every itemName exists in your inventory. See Inventory Items for the default servicing items and Pricing to set their shop costs.
The default parts affect vehicles as follows:
- Suspension affects suspension stiffness, anti-roll force and body damage sounds.
- Tyres affect traction.
- Brake pads affect braking force.
- The clutch affects gear changes.
- Spark plugs and EV batteries affect acceleration.
- Engine oil, air filters, EV coolant and EV motors affect acceleration and top speed.
Don't add, remove or rename the servicing part entries. The tablet and vehicle handling use the existing part names.
The enableDamage option in config/config.servicing.lua doesn't currently stop an individual part from wearing. Leave it set to true. Use Config.EnableVehicleServicing or Config.ServicingBlacklist when you need to prevent servicing wear.
Servicing changes the vehicle's existing handling values. Addon vehicles with unusual handling can react differently as parts wear, so test your intervals with the vehicles used on your server.
Restart jg-mechanic after changing either config file.