Advertisement
Dudugz-Contistente

Untitled

Aug 26th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. mapas={7223062,7054603,7054531,7054546,7054560,7054552,7052544,7052537,7202743,7052522,7051720,7050627,7051652,7051630,7051619,7051569,7051547,7050402,7050558,7050503,7050581,7050580,7050562 ,70505521,7046681,7047815,7047835,7047897,7048753,7049425,7049270,7049421,7049292,7050189,7049463,7050308,7050400,7050402,7049463}
  2.  
  3. data={}
  4.  
  5. vivos = 5
  6. p=0
  7.  
  8. tfm.exec.disableAutoShaman(true)
  9. tfm.exec.disableAutoTimeLeft(true)
  10. tfm.exec.disableAutoNewGame()
  11.  
  12. textarea=ui.addTextArea
  13. function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,active)
  14. --if not backgroundColor then backgroundColor=0x324650 end
  15. --if not borderColor then borderColor=0x000001 end
  16. if active then
  17. textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
  18. textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
  19. end
  20. textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
  21. end
  22.  
  23. function eventPlayerGetCheese(name)
  24. tfm.exec.killPlayer(name)
  25.  
  26. if tfm.get.room.playerList[name] then
  27. tfm.exec.addShamanObject(tfm.enum.shamanObject.chicken,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
  28.  
  29. for i=1,20 do
  30. tfm.exec.displayParticle(13, tfm.get.room.playerList[name].x+math.random(-10,10), tfm.get.room.playerList[name].y+math.random(-10,10),math.random(-math.random(5,10),math.random(5,10)),math.random(-math.random(5,10),math.random(5,10)))
  31. end
  32. end
  33. end
  34.  
  35. function eventNewGame()
  36. tfm.exec.setGameTime(120)
  37. vivos=0
  38. for i,v in pairs(tfm.get.room.playerList) do -- i = nome, v = info
  39. vivos=vivos+1;
  40. tfm.exec.giveMeep(i)
  41. end
  42. end
  43.  
  44. function eventLoop(time,remaining)
  45. p=time
  46. if remaining < 1000 or vivos <= 0 then -- se o tempo do mapa está menor que 1 ou seja 0, ou não tem nenhum vivo
  47. tfm.exec.newGame(mapas[math.random(#mapas)])
  48.  
  49. if not winner and not (remaining < 1000) then
  50. tfm.exec.chatMessage("<B>Ninguém venceu.</B>")
  51. elseif not winner and remaining < 1000 then
  52. tfm.exec.chatMessage("<N><B>O tempo acabou e ninguém venceu.</B></N>")
  53. end
  54. end
  55.  
  56. if vivos <= 1 then
  57. winner = false
  58. eventPlayerDied()
  59. end
  60. end
  61.  
  62.  
  63. function eventPlayerDied(name)
  64. vivos=vivos-1;
  65.  
  66. if vivos <= 1 then
  67. for i,v in pairs(tfm.get.room.playerList) do
  68. if not v.isDead then -- verefica se o jogador não morreu
  69. tfm.exec.giveCheese(i)
  70. tfm.exec.playerVictory(i)
  71. name = i
  72. tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x-12, tfm.get.room.playerList[name].y,0,-5)
  73. tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y-7,0,-5)
  74. tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x+12, tfm.get.room.playerList[name].y,0,-5)
  75. tfm.exec.displayParticle(34, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y-7,0,-5)
  76.  
  77. end
  78. end
  79. end
  80. end
  81.  
  82. function eventPlayerWon(name)
  83. vivos=vivos-1;
  84. winner = true
  85.  
  86. data[name].wins = data[name].wins+1;
  87.  
  88. tfm.exec.chatMessage("<B>"..name.."</B> venceu.")
  89. end
  90.  
  91. function eventNewPlayer(name)
  92. if not data[name] then
  93. data[name]={
  94. wins=0
  95. }
  96. end
  97.  
  98. for _,msg in pairs({"Olá <B>"..name.."</B> bem-vindo ao New Meep Attack.","Mate outros jogadores fazendo eles encostar no queijo com meep."}) do
  99. tfm.exec.chatMessage(msg,name)
  100. end
  101. end
  102.  
  103. tfm.exec.setRoomMaxPlayers(30)
  104. table.foreach(tfm.get.room.playerList,eventNewPlayer)
  105. tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement