Resource won't start / infinite hang
Symptom: Console shows WARNING: Resource name is changed!
Fix: Rename the folder to exactly s4-wheeldamage. The script blocks execution if the resource name differs.
Crash damage not triggering
Check:
Config.EnableMinCrashSpeed— Is your crash speed aboveConfig.MinCrashSpeed(default 5.0 m/s)?Config.Ignore— Is your vehicle class or model in the ignore list?Config.HitIgnore— Is the raycast hitting a ped instead of a wall/object?Config.DetectionTimeForNextCrash— Wait 1 second between consecutive crashes.
Debug: Set Config.TestMode = true to see 3D rays, speed, and surface material at each indicator point.
Wheels don't break off
Check:
- Impact speed must be ≥ 21.0 m/s (
Config.DamageLevels[2].min) - The wheel indicator ray must hit something (
endCoordsnot zero) Config.OldVersion = falseusesBreakOffVehicleWheel(recommended)- If
Config.OldVersion = true, uses legacy tire collider method
Toolbox won't place
Check:
- You must be on foot (not inside a vehicle)
- Only one toolbox can be active at a time
repair_toolboxitem must be registered and usable via s4-bridge- Check F8 console for model load errors
Repair tools say "toolbox in use"
Another repair workflow is already active. Either:
- Complete the current repair
- Press X to cancel
- Target the toolbox and select Cancel
- Restart the resource as last resort
Hood/trunk target not working
Check:
- Is
qb-targetinstalled? Target options require it. - Is the vehicle locked?
canInteractchecksGetVehicleDoorLockStatus(entity) ~= 2 - For engine/radiator repair, hood must be open first
- For fuel tank repair, trunk must be open first
Mechanic repair doesn't clear wheel damage
Check:
Config.EnableCompatible = true- Your mechanic script's event name is in
compatible.lua - If using custom repair, call the export manually:
exports['s4-wheeldamage']:FullyRepairVehicle(vehicle)
Land restriction not applying
Check:
Config.EnableLandRestriction = truelandData.jsonexists and has data for your vehicle class- Run
/editLandResto verify settings - Speed limit of
0means no limit for that surface
Notifications not showing
The script uses ox_lib notify via the 0r-core:notif event. Ensure:
ox_libis started before s4-wheeldamage@ox_lib/init.luais loaded (defined infxmanifest.lua)
Server sync issues
Damaged wheel state is stored in the Cars table and synced via syncCars server event.
If wheels appear fine for one player but broken for another:
- Check server console for errors in
server/server.lua - Ensure
s4-bridgeframework callbacks work (getSyncCars) - Restart the resource to clear stale state
Config.TireItem error
If you see errors about Config.TireItem being nil when repairing wheels:
Add to config.lua:
Config.TireItem = "repair_tire"
And register the item in your inventory. This is only needed when wheel repair consumes a standalone tire item from inventory.