DarkLink Posted July 14, 2012 Share Posted July 14, 2012 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
DarkLink Posted July 14, 2012 Author Share Posted July 14, 2012 Problem fixed, thanks 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