Hadif Posted July 27, 2015 Share Posted July 27, 2015 (edited) Anyone knows how to make a script that blow a car if the car drown into the water for 60 second? Please help, I can't find the solution. Thank you! Edited August 3, 2015 by Guest Link to comment
LabiVila Posted July 27, 2015 Share Posted July 27, 2015 You can using this function: https://wiki.multitheftauto.com/wiki/GetWaterLevel, and try to do it yourself before asking for full script (as you did 2-3 previous times) Link to comment
Hadif Posted July 27, 2015 Author Share Posted July 27, 2015 You can using this function: https://wiki.multitheftauto.com/wiki/GetWaterLevel, and try to do it yourself before asking for full script (as you did 2-3 previous times) thanks bro, i didnt know that the function is available.. Link to comment
Hadif Posted July 27, 2015 Author Share Posted July 27, 2015 addEventHandler ( "onClientResourceStart", resourceRoot, local theVehicle = getElementsByType ( "vehicle" ) function ( ) setTimer ( function ( ) for theKey, theVehicle in ipairs ( theVehicle ) do if isElementInWater ( theVehicle ) then blowVehicle ( theVehicle ) end end end, 30000, 0 ) end ) Do you think this would work? *I can't test it right now, 'couse it's time for me to sleep. Just want to get the answer fast when I awake from dream... Link to comment
HUNGRY:3 Posted July 27, 2015 Share Posted July 27, 2015 you made a little mistake NOTE: the car won't blow up if it's down down in the water and it will get blowed every time addEventHandler ( "onClientResourceStart", resourceRoot, function () local theVehicle = getElementsByType ( "vehicle" ) setTimer ( function ( ) for theKey, theVehicle in ipairs ( theVehicle ) do if isElementInWater ( theVehicle ) then blowVehicle ( theVehicle ) end end end, 30000, 0 ) end ) Link to comment
Hadif Posted July 27, 2015 Author Share Posted July 27, 2015 you made a little mistakeNOTE: the car won't blow up if it's down down in the water and it will get blowed every time addEventHandler ( "onClientResourceStart", resourceRoot, function () local theVehicle = getElementsByType ( "vehicle" ) setTimer ( function ( ) for theKey, theVehicle in ipairs ( theVehicle ) do if isElementInWater ( theVehicle ) then blowVehicle ( theVehicle ) end end end, 30000, 0 ) end ) Can you help me fix my problem, my brain is stuck right now. Link to comment
Perfect Posted July 27, 2015 Share Posted July 27, 2015 addEventHandler ( "onClientResourceStart", resourceRoot, function () local theVehicle = getElementsByType ( "vehicle" ) setTimer ( function ( ) for theKey, theVehicle in ipairs ( theVehicle ) do if isElementInWater ( theVehicle ) then blowVehicle ( theVehicle ) setTimer(destroyElement(theVehicle), 29000, 1) end end end, 30000, 0 ) end ) Link to comment
Hadif Posted July 28, 2015 Author Share Posted July 28, 2015 Finally, it works! Thank you guys for helping me! 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