hi all am new at scripting lua but am lurning hard
i have one quastion,
how to respawn barrel and those missel and other object that can explode ore damage ore broken.
i know litelbit of respawning car and pickups.
but object that can be destroied i dont know i like to know how ore cant object respawn
function respawnVehicle( vehicle )
spawnVehicle ( vehicle, getElementData( vehicle, "posX" ), getElementData( vehicle, "posY" ), getElementData( vehicle, "posZ" ), getElementData( vehicle, "rotX" ), getElementData( vehicle, "rotY" ), getElementData( vehicle, "rotZ" ) )
end
function onVehicleSpawn ()
local x,y,z = getElementPosition (source)
setElementData (source,"posX",x)
setElementData (source,"posY",y)
setElementData (source,"posZ",z)
end
addEventHandler ("onVehicleExplode",getRootElement(),onVehicleSpawn)
function onVehicleExplode ()
setTimer( respawnVehicle, 5000, 1, source )
end
addEventHandler("onVehicleExplode", getRootElement(), onVehicleExplode)
this is a car respowner can i change some and make it to object respawner?