Advertisement
Dudugz-Contistente

Untitled

Aug 27th, 2017
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. sys={times={},newTimer=function(callback, tempo, arg1, arg2, arg3, arg4)if arg1 == nil and arg2 == nil and arg3 == nil and arg4 == nil then table.insert(sys.times,{call=callback, tempo=tempo, timer=os.time(), args={}}) end if arg1 ~= nil and arg2 == nil then table.insert(sys.times,{call=callback, tempo=tempo, timer=os.time(), args={arg1}}) end if arg1 ~= nil and arg2 ~= nil and arg3 == nil then table.insert(sys.times,{call=callback, tempo=tempo, timer=os.time(), args={arg1,arg2}}) end if arg1 ~= nil and arg2 ~= nil and arg3 ~= nil and arg4 == nil then table.insert(sys.times,{call=callback, tempo=tempo, timer=os.time(), args={arg1,arg2,arg3}}) end if arg1 ~= nil and arg2 ~= nil and arg3 ~= nil and arg4 ~= nil then table.insert(sys.times,{call=callback, tempo=tempo, timer=os.time(), args={arg1,arg2,arg3,arg4}}) end return #sys.times end, removeTimer=function(id) table.remove(sys.times,id) end, eventLoop=function() for i,v in ipairs(sys.times) do if v.timer < os.time()-(v.tempo) then if v.args[1] == nil then v.call() end if v.args[1] ~= nil and v.args[2] == nil then v.call(v.args[1]) end if v.args[1] ~= nil and v.args[2] ~= nil and v.args[3] == nil then v.call(v.args[1],v.args[2]) end if v.args[1] ~= nil and v.args[2] ~= nil and v.args[3] ~= nil and v.args[4] == nil then v.call(v.args[1],v.args[2],v.args[3]) end if v.args[4] ~= nil then v.call(v.args[1],v.args[2],v.args[3],v.args[4]) end table.remove(sys.times,i) end end end}
  2.  
  3. mapas={7050616,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}
  4.  
  5. data={}
  6.  
  7. vivos = 5
  8. p=0
  9.  
  10. tfm.exec.chatMessage=print
  11. tfm.exec.disableAutoShaman(true)
  12. tfm.exec.disableAutoTimeLeft(true)
  13. tfm.exec.disableAutoNewGame()
  14.  
  15. textarea=ui.addTextArea
  16. function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,active)
  17. --if not backgroundColor then backgroundColor=0x324650 end
  18. --if not borderColor then borderColor=0x000001 end
  19. if active then
  20. textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
  21. textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
  22. end
  23. textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
  24. end
  25.  
  26. function eventPlayerGetCheese(name)
  27. tfm.exec.killPlayer(name)
  28.  
  29. if tfm.get.room.playerList[name] then
  30. tfm.exec.addShamanObject(tfm.enum.shamanObject.chicken,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
  31.  
  32. for i=1,20 do
  33. 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)))
  34. end
  35. end
  36. end
  37.  
  38. function eventChatMessage(name,cmd)
  39. local helpMessage=false
  40.  
  41. for _,k in pairs({"ajuda?","!help","como joga?","como jogar?","como solta meep?","meep?","jogar?","joga?"}) do
  42. if cmd:find(k) then
  43. helpMessage=true
  44. end
  45. end
  46.  
  47. if helpMessage then
  48. tfm.exec.chatMessage("<CEP>> [br] [<CE>Guhzumaki</CE>] Olá "..name.." parece que você precisa de ajuda, pois bem vou te ajudar.",name)
  49. sys.newTimer(tfm.exec.chatMessage,200,"<CEP>> [br] [<CE>Guhzumaki</CE>] O seu objetivo no Meep Attack é ser o último vivo para vencer.",name)
  50. sys.newTimer(tfm.exec.chatMessage,1000,"<CEP>> [br] [<CE>Guhzumaki</CE>] Mas você tem um inimigo maior, o queijo, tome muito cuidado pois estes queijos estão envenenados e ao pegá-los você vira uma galinha e morre.",name)
  51. sys.newTimer(tfm.exec.chatMessage,2000,"<CEP>> [br] [<CE>Guhzumaki</CE>] Mate os outros jogadores usando o Meep para vencer, espere a barrinha do meep encher e ao ficar cheia pressione espaço para soltar um meep.",name)
  52. end
  53.  
  54. end
  55.  
  56. function eventNewGame()
  57. tfm.exec.setGameTime(120)
  58. vivos=0
  59. for i,v in pairs(tfm.get.room.playerList) do -- i = nome, v = info
  60. vivos=vivos+1;
  61. tfm.exec.giveMeep(i)
  62. end
  63. end
  64.  
  65. function eventLoop(time,remaining)
  66. sys.eventLoop()
  67. p=time
  68. 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
  69. tfm.exec.newGame(mapas[math.random(#mapas)])
  70.  
  71. if not winner and not (remaining < 1000) then
  72. tfm.exec.chatMessage("<B>Ninguém venceu.</B>")
  73. elseif not winner and remaining < 1000 then
  74. tfm.exec.chatMessage("<N><B>O tempo acabou e ninguém venceu.</B></N>")
  75. end
  76. end
  77.  
  78. if vivos <= 1 then
  79. winner = false
  80. eventPlayerDied()
  81. end
  82. end
  83.  
  84.  
  85. function eventPlayerDied(name)
  86. vivos=vivos-1;
  87.  
  88. if vivos <= 1 then
  89. for i,v in pairs(tfm.get.room.playerList) do
  90. if not v.isDead then -- verefica se o jogador não morreu
  91. tfm.exec.giveCheese(i)
  92. tfm.exec.playerVictory(i)
  93. name = i
  94. tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x-12, tfm.get.room.playerList[name].y,0,-5)
  95. tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y-7,0,-5)
  96. tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x+12, tfm.get.room.playerList[name].y,0,-5)
  97. tfm.exec.displayParticle(34, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y-7,0,-5)
  98.  
  99. end
  100. end
  101. end
  102. end
  103.  
  104. function eventPlayerWon(name)
  105. vivos=vivos-1;
  106. winner = true
  107.  
  108. data[name].wins = data[name].wins+1;
  109.  
  110. tfm.exec.chatMessage("<B>"..name.."</B> venceu.")
  111. ui.addTextArea(-5,"<B><font size='75' color='#7F7F7F' face='Berlin Sans FB Demi'>"..name.." venceu</font>",nil,100,250,nil,nil,0,0,0,true)
  112. ui.addTextArea(-8,"<B><font size='75' color='#F7F7F7' face='Berlin Sans FB Demi'>"..name.." venceu</font>",nil,100-3,250-2,nil,nil,0,0,0,true)
  113. sys.newTimer(ui.removeTextArea,1000,-5,nil)sys.newTimer(ui.removeTextArea,1000,-8,nil)
  114. end
  115.  
  116. function eventNewPlayer(name)
  117. if not data[name] then
  118. data[name]={
  119. wins=0
  120. }
  121. end
  122.  
  123. for _,msg in pairs({"Olá <B>"..name.."</B> bem-vindo ao New Meep Attack.","<VP><B>Mate outros jogadores fazendo eles encostar no queijo com meep.</B></VP>"}) do
  124. tfm.exec.chatMessage(msg,name)
  125. end
  126.  
  127. ui.addTextArea(-10,"<B><font size='75' color='#7F7F7F' face='Berlin Sans FB Demi'>Meep Attack</font>",name,200,100,nil,nil,0,0,0,true)
  128. ui.addTextArea(-15,"<B><font size='75' color='#F7F7F7' face='Berlin Sans FB Demi'>Meep Attack</font>",name,200-3,100-2,nil,nil,0,0,0,true)
  129. sys.newTimer(ui.removeTextArea,2000,-10,name)sys.newTimer(ui.removeTextArea,2000,-15,name)
  130. end
  131.  
  132. tfm.exec.setRoomMaxPlayers(30)
  133. table.foreach(tfm.get.room.playerList,eventNewPlayer)
  134. tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement