undefined Posted July 23, 2014 Share Posted July 23, 2014 Hi guys. I have a problem. My timer is not work and give this warning: And my code: healKac = guiGridListGetItemData ( NPCGrid, row, 1 ) makeHealTime = guiGridListGetItemData ( NPCGrid, row, 3 ) makeHealT = setTimer( function() -- Line 280 local health = getElementHealth(localPlayer) if (health and health < 200) then setElementHealth(localPlayer,health+healKac) end end, makeHealTime, 0) Where is the problem? Link to comment
Anubhav Posted July 23, 2014 Share Posted July 23, 2014 healKac = guiGridListGetItemData ( NPCGrid, row, 1 ) makeHealTime = guiGridListGetItemData ( NPCGrid, row, 3 ) makeHealT = setTimer( function() -- Line 280 local health = getElementHealth(localPlayer) if (health and health < 200) then setElementHealth(localPlayer,health+healKac) end end, makeHealTime, 50) 3rd argument.. Your intervel of ms should not go down of 50. Link to comment
Karuzo Posted July 23, 2014 Share Posted July 23, 2014 healKac = guiGridListGetItemData ( NPCGrid, row, 1 ) makeHealTime = guiGridListGetItemData ( NPCGrid, row, 3 ) makeHealT = setTimer( function() -- Line 280 local health = getElementHealth(localPlayer) if (health and health < 200) then setElementHealth(localPlayer,health+healKac) end end, makeHealTime, 50) 3rd argument.. Your intervel of ms should not go down of 50. You're completely wrong. 1. the 3rd argument is the time to execute. 2. the 2nd argument is the time interval. So your code makes no sense. Link to comment
Anubhav Posted July 23, 2014 Share Posted July 23, 2014 Whoops, I forgot everything lol. 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