Advertisement
Dudugz-Contistente

Untitled

Feb 3rd, 2017
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. --Váriaveis e Tabelas
  2.  
  3. p={}
  4.  
  5. --Eventos
  6.  
  7. textarea=ui.addTextArea
  8. function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,effect)
  9. --if not backgroundColor then backgroundColor=0x324650 end
  10. --if not borderColor then borderColor=0x000001 end
  11. if effect then
  12. textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
  13. textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
  14. end
  15. textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
  16. end
  17.  
  18. function eventNewPlayer(name)
  19. p[name]={
  20. life= 100
  21. }
  22.  
  23. bar(name)
  24. end
  25.  
  26. function bar(name)
  27. if p[name].life > 0 then
  28. ui.addTextArea(0,"",name,8,28,200,16,0xCD0000,0xCD0000,nil,true,true)
  29. ui.addTextArea(1,"",name,8,28,math.floor(p[name].life*2),16,0xFF0000,0xFF0000,nil,true,true)
  30. else
  31. ui.removeTextArea(1,name)
  32. ui.removeTextArea(6969+1,name)
  33. ui.removeTextArea(7979+1,name)
  34. end
  35. end
  36.  
  37. function gl_life(name,gl)
  38. p[name].life = p[name].life+gl
  39. if p[name].life <= 0 then
  40. p[name].life = 0
  41. tfm.exec.killPlayer(name)
  42. end
  43.  
  44. bar(name)
  45. end
  46.  
  47. for all in pairs(tfm.get.room.playerList) do
  48. eventNewPlayer(all)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement