JohnDoe91286 Posted May 16, 2009 Share Posted May 16, 2009 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. Link to comment
DakiLLa Posted May 17, 2009 Share Posted May 17, 2009 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 ) Link to comment
JohnDoe91286 Posted June 15, 2009 Author Share Posted June 15, 2009 And does that go in a seperate .lua or in the .map file? Link to comment
Lordy Posted June 15, 2009 Share Posted June 15, 2009 Well.. map file is with xml syntax, script is with lua syntax. Take your guess. Link to comment
Thehookerkiller01 Posted June 27, 2009 Share Posted June 27, 2009 How to only respawn the vehicles from the script? And not respawn other vehicles? Edit: map file. Link to comment
50p Posted June 27, 2009 Share Posted June 27, 2009 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. Link to comment
Thehookerkiller01 Posted June 27, 2009 Share Posted June 27, 2009 50p said: 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. So, why deleting vehicles on other resources? Link to comment
50p Posted June 27, 2009 Share Posted June 27, 2009 Because that was a question a guy asked... If you have some knowledge about scripting in Lua than you can modify it easily. Every single post of yours doesn't show any skills you have but good luck... BTW, STOP POSTING SHIT REPLIES IF YOU CAN'T EVEN HELP YOURSELF! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now