hi everyone, I have script of anti veh zone it works, but when the vehicle destroyed, it never respawn, anyone help?
local positions = {
{xxx, xxx, xxx, xxx},
}
local aRadarAreaPlaces = {
{ xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx },
}
function pos()
for k, v in ipairs(positions) do
local mycol = createColRectangle (v[1], v[2], v[3], v[4])
for _, a in ipairs( aRadarAreaPlaces ) do
local pRadarArea = createRadarArea ( unpack( a ) )
addEventHandler ("onColShapeHit", mycol, destroyTheVehicles)
addEventHandler ("onColShapeHit", pRadarArea, destroyTheVehicles)
end
end
end
addEventHandler("onResourceStart", resourceRoot, pos)
function destroyTheVehicles (hitElement, dimension)
if (getElementType(hitElement) ~= "vehicle" or not dimension) then
return
end
local player = getVehicleController(hitElement)
if (isElement(player)) then
end
destroyElement(hitElement)
setTimer(respawnVehicle,5000,0)(hitElement)
end