Advertisement
Dudugz-Contistente

Untitled

Oct 22nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. lifes = 0
  2. deads = 0
  3.  
  4. tfm.exec.disableAutoShaman(true)
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAfkDeath(true)
  7. tfm.exec.disableAutoTimeLeft(true)
  8. tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
  9. ui.setMapName("<CS>[Sobrevivite]</CS> <BL>|</BL> <N>Ratos Vivos : <V>"..lifes.."</V></N> <BL>|</BL> <N>Ratos Mortos : <V>"..deads.."</V>")
  10.  
  11. p = {}
  12. data = {}
  13. remove = {}
  14. spawn = os.time();
  15. vivos = 0;
  16.  
  17.  
  18. function eventNewGame()
  19. lifes = 0
  20. deads = 0
  21. ui.setMapName("<CS>[Sobrevivite]</CS> <BL>|</BL> <N>Ratos Vivos : <V>"..lifes.."</V></N> <BL>|</BL> <N>Ratos Mortos : <V>"..deads.."</V>")
  22. end
  23.  
  24.  
  25. function eventLoop(t,r)
  26. for i,v in ipairs(remove) do
  27. if v.time <= os.time()-3000 then
  28. tfm.exec.removeObject(v.cn)
  29. table.remove(remove, i)
  30. end
  31. end
  32. if r <= 0 then
  33. tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
  34. end
  35. end
  36.  
  37. function eventPlayerDied(name)
  38. vivos=vivos-1;
  39. deads = deads + 1
  40. lifes = lifes - 1
  41. ui.setMapName("<CS>[Sobrevivite]</CS> <BL>|</BL> <N>Ratos Vivos : <V>"..lifes.."</V></N> <BL>|</BL> <N>Ratos Mortos : <V>"..deads.."</V>")
  42. local a = 0
  43. for i,v in pairs(tfm.get.room.playerList) do
  44. if not v.isDead then
  45. a = a + 1
  46. end
  47. end
  48. if a < 1 then
  49. tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
  50. end
  51. end
  52.  
  53. function eventPlayerWon(name)
  54. vivos=vivos-1;
  55. data[name].wins = data[name].wins + 1
  56. ui.addTextArea(0,"<font color='#FFFFFF'>Jogadores/Pontos : \n<VI>★"..table.concat(p, '\n').."</VI> = <font color='#FFD100'>"..data[nome].wins.."",nil,680,28,115,0,0x153139,0x132C33,1,true)
  57. if vivos < 1 then
  58. tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
  59. end
  60. end
  61.  
  62. function eventKeyboard(name, key, down, x, y)
  63. tfm.get.room.playerList[name].x = x
  64. tfm.get.room.playerList[name].y = y
  65.  
  66. if (key == 2) then
  67. tfm.get.room.playerList[name].isFacingRight = true
  68. elseif (key == 0) then
  69. tfm.get.room.playerList[name].isFacingRight = false
  70. elseif (key == 3) and not tfm.get.room.playerList[name].isDead then
  71. if data[name].spawn < os.time()-5000 then
  72. local obj
  73. if tfm.get.room.playerList[name].isFacingRight then
  74. obj = tfm.exec.addShamanObject(17,x+2,y+8,90)
  75. else
  76. obj = tfm.exec.addShamanObject(17,x-2,y+8,-90)
  77. end
  78. table.insert(remove, {time=os.time(),cn=obj})
  79.  
  80. data[name].spawn = os.time();
  81. end
  82. end
  83. end
  84.  
  85. function eventNewPlayer(name)
  86. table.insert(p,name)
  87. data[name] ={
  88. wins = 0,
  89. spawn = 0,
  90. }
  91.  
  92. local text=''
  93.  
  94. for name in pairs(tfm.get.room.playerList) do
  95. if data[name] then text=(text == "" and "<VI>"..name.."</VI> = <font color='#FFD100'>"..data[name].wins.."</font>" or text..'\n'.."<VI>"..name.."</VI> = <font color='#FFD100'>"..data[name].wins.."</font>") end
  96. end
  97.  
  98. ui.addTextArea(0,"<font color='#FFFFFF'>Jogadores/Pontos : \n"..text,nil,680,28,115,0,0x153139,0x132C33,1,true)
  99. for keys, k in pairs({0,1,2,3,32,17,69}) do
  100. tfm.exec.bindKeyboard(name,k,true,true)
  101. end
  102. end
  103.  
  104. for all in pairs(tfm.get.room.playerList) do
  105. eventNewPlayer(all)
  106. tfm.exec.giveMeep(all)
  107. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement