Jump to content

Car respawn


Recommended Posts

Posted

I have made a script for car spawn points all over LS the only problem is I can't seem to make a respawner. I need the cars to respawn 10 secs after they explode. Anybody got a basic script for that.

Posted

try this:

function explodeDestroy () 
    local vehicles = getElementsByType( "vehicle" ) 
    for k,v in ipairs( vehicles ) do 
        if ( getElementHealth( v ) < 25 ) then 
            setTimer( destroyElement, 10000, 1, v ) 
        end 
    end 
end 
addEventHandler( "onVehicleExplode", getRootElement (), explodeDestroy ) 

  • 4 weeks later...
  • 2 weeks later...
Posted

I posted code responsible for respawn of vehicles in map file looong time ago... https://forum.multitheftauto.com/viewtop ... 70#p280170 (onVehicleExplode) This code will destroy vehicles which were created with createVehicle and vehicles that are not created with your resource. You can delete some of "if" statements to make it work as you want.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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