Car Disable Script Once Damaged Enough

As the title states, i am looking for some sort of script that endues damage once you hit a pole at speed or even hitting a wall or other cars will disable a vehicle. this would be nice to stop people from dragging on a pursuit and making it last for hours… Any info on this would be greatly appreciated!

It should look something like this, it’s not the entire script though.

local ped = GetPlayerPed(-1)
local car = GetVehiclePedIsIn(ped, false)
if GetVehicleEngineHealth(car) < 750 then -- max engine health 1000 lowest is 0
   SetVehicleHalt(car, 3.0, 1)

i did this real quick and didn’t test it so it might not work at all.

you can also get the petrol tank health and the body health.

1 Like

local ped = GetPlayerPed(-1)
local car = GetVehiclePedIsIn(ped, false)

while true do
if GetVehicleEngineHealth(car) < 750
then SetVehicleHalt(car, 3.0, 1)

Tried that… No luck

try using GET_VEHICLE_BODY_HEALTH(Vehicle vehicle)

i’ll actually go and try this myself now

I already helped him with it. You can PM me if you want to know how to do it too.

Can someone please close this topic!!!