Tails Posted November 15, 2012 Posted November 15, 2012 Hi there, function explodeVehiclesInWater ( ) local vehicles = getElementsByType ( "vehicle" ) for _, vehicle in ipairs ( vehicles ) do if isElementInWater( vehicle ) then setTimer ( function() blowVehicle( vehicle, true ) end, 10000, 1 ) end end end addEventHandler ( "onResourceStart", root, explodeVehiclesInWater ) If you read the script then you know I want. I need this script to explode vehicles when they go under water. Ofcourse it's not working so if anyone could take a look and tell me what's wrong with it I would appreciate it a lot! Thanks in advance Discord: its.tails
Castillo Posted November 15, 2012 Posted November 15, 2012 You want to check every 10 seconds for vehicles in wanter and blow them up? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Tails Posted November 15, 2012 Author Posted November 15, 2012 No, this is a script for freeroam, so if you someone drives their vehicle into the water I need it to explode so my respawn script can respawn it. Discord: its.tails
Castillo Posted November 15, 2012 Posted November 15, 2012 Yes, but your script is currently setting a timer for every vehicle that is in water to blow it up, only when the resource start. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Tails Posted November 15, 2012 Author Posted November 15, 2012 Okay but how do I fix that? Discord: its.tails
Castillo Posted November 15, 2012 Posted November 15, 2012 setTimer ( function ( ) for _, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do if isElementInWater ( vehicle ) then blowVehicle ( vehicle, true ) end end end , 10000, 0 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Tails Posted November 15, 2012 Author Posted November 15, 2012 Thank you , I appreciate it! Although, I found it won't explode sometimes when the player isn't in the vehicle. Discord: its.tails
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