---meta-- call this "meta.xml"
<meta>
<info author="NONE" description="respawn" version="1" type="script" />
<script src="respawn.lua" />
</meta>
--server--call this "respawn.lua"
function respawn()
for i,vehicle in ipairs(getElementsByType("vehicle")) do
toggleVehicleRespawn(vehicle, true)
setVehicleRespawnDelay(vehicle, 20000)
end
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), respawn)
Put the meta and the server script inside a folder.
> setVehicleRespawnDelay(vehicle, 20000)
20000 = 20 seconds for respawn.