xScatta Posted October 15, 2014 Share Posted October 15, 2014 Hi all i have a problem i will put code now and the description of problem will be under. function healMedic() for key, player in ipairs(getElementsByType( "player")) do local hp = getElementHealth(player) setElementHealth(player,hp+1) end end setTimer(healMedic,1000,0) So. why my health raises only one time? But if i replace "+" with "-" it will fall down but when it is "+" then it raises only once. Any help.? Thanks. Link to comment
manawydan Posted October 15, 2014 Share Posted October 15, 2014 you can check if player health no is full, here work if health max is 100. function healMedic() for key, player in ipairs(getElementsByType( "player")) do local hp = getElementHealth(player) if(hp<=99)then setElementHealth(player,hp+1) end end end setTimer(healMedic,1000,0) 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