Jump to content

Event "onVehiclePreExplode"


Recommended Posts

  • 4 weeks later...
Posted
You can use onVehicleDamage > setElementHealth.

This is however really buggy sometimes when a vehicle gets a large ammount of damage in a short ammount of time (E.G: When you drive over it with a dumper) - This can be seen in lots of RP servers.

Posted

You can use this:

local myCars = {} 
  
addEventHandler("onVehicleDamage", root, 
function() 
    if getElementHealth(source) < 300 and not myCars[source] then 
        myCars[source] = true 
        setElementHealth(source, 300) 
        setVehicleDamageProof(source, false) 
    end 
end) 

If the car's health has less than 300 then set the vehicle damage proof to false.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...