Jump to content

Solve: Make a Script that Blow a Car if Car Drown


Hadif

Recommended Posts

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... :D

Link to comment

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
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 
) 

Can you help me fix my problem, my brain is stuck right now. :shock:

Link to comment
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

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...