Jump to content

Solved..


1LoL1

Recommended Posts

Hello, i created script but idk how to respawnVehicle if is in water. :( Can anyone help me please?

i tried this but not work :(

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function ()  
car = createVehicle(id, x, y, z, rx, ry, rz) 
end) 
  
function RSP () 
if isElementInWater(car) then 
setTimer(respawnVehicle(car), 1000, 1) 
    end 
end 
  

This work normally.

addEventHandler("onVehicleExplode", getRootElement(), 
function () 
    setTimer(respawnVehicle, 5000, 1, source) 
end) 

Edited by Guest
Link to comment
change your timer to;
setTimer ( RSP, 5000, 1, source ) 

after that you might have to change the RSP() to RSP ( car ) since the car will most likely not stay global ( once it exploded, the element will not be the same anymore ).

Don't understand if i put this then where is respawnVehicle?

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