Jump to content

Respawning after blowing


DarkLink

Recommended Posts

Hi there, I am trying to make a script over here, and is not working..

Look my code:

  
function setVehiResp() 
        local vehi = createVehicle ( 497, x, y, z + 1) 
    addEventHandler("onVehicleExplode", vehi, function() setRespwnTim(x,y,z) end ) 
  
end 
addEventHandler("heliUpgrade", getRootElement(), upgradeHeliSpawn) 
  
function setRespwnTim(x,y,z) 
    setTimer(function(x, y, z) createVehicle(497, x,y,z+1) addEventHandler("onVehicleExplode", this, function() setRespwnTim(x,y,z) end)  end, 2000,1, x,y,z)  -- this is the line 20 
end  
  

WARNING: [gamemodes]\[bp]\bp\server_money.lua:20: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]

The argument "this" was suppose to work.. since its the element that the event was attached, the element vehi..

Thanks alot in advance!

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