Advertisement
Dudugz-Contistente

Untitled

Aug 21st, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.84 KB | None | 0 0
  1. -- Sistema de times v1.0.
  2. -- Criado por Contistente.
  3. -- Por favor não retire os créditos.
  4.  
  5. vivos = 0
  6. blue = {}
  7. green = {}
  8. data={}
  9.  
  10. jogadores = {}
  11.  
  12. start=false
  13.  
  14. for _,v in pairs ({'disableAutoNewGame','disableAutoShaman','disableAutoTimeLeft','disableAutoScore'}) do
  15. tfm.exec[v](true)
  16. end
  17.  
  18. function eventNewPlayer(name)
  19. if not data[name] then
  20. data[name]={
  21. haveTeam=false,
  22. time_shoot=os.time()
  23. }
  24.  
  25. table.insert(jogadores,{name,false})
  26. end
  27.  
  28. ui.addTextArea(0, "\n\n\n\n<p align=\"center\"><N><font size=\"16\">Oieee , Sejam todos bem vindos ao <B>PokéViper</B> novo module , para jogar e muito simples você será de 1 time azul ou verde seu objetivo e pega a Pokébolla do outro lá do campo ... Mais cuidado lembre-se isso é 1 jogo de pokémon poderes vão ter !!!", name, 226, 126, 383, 201, 0x172a33, 0x000000, 1, true)ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  29. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  30. ui.addTextArea(2, "<a href='event:close_help'><font size=\"15\"><B><font color=\"#b50909\">X", name, 587, 127, 21, 25, 0xb50909, 0x000000, 0, true)
  31. ui.addTextArea(3, "<font size=\"20\"><a href='event:open_credits'><font size=\"20\"><p align=\"center\">Creditos</a>", name, 260, 126, 100, 36, 0x1bd428, 0x000000, 0, true)
  32. ui.addTextArea(4, "<font size=\"20\"><a href='event:open_shop'><font size=\"20\"><p align=\"center\">Shop</a>", name, 475, 127, 100, 36, 0x1bd428, 0x000000, 0, true)
  33. ui.addTextArea(5, "<a href='event:open_help'><font size=\"20\"><p align=\"center\"><VP>Help</a>", name, 367, 126, 100, 47, 0x324650, 0x000000, 0, true)
  34. tfm.exec.chatMessage('Nossos comandos : !help , !shop , !credito', name)
  35.  
  36. tfm.exec.bindKeyboard(name,32,true,true)
  37.  
  38. for name in pairs(tfm.get.room.playerList) do
  39. tfm.exec.bindKeyboard(name,32,true,true)
  40. end
  41. end
  42.  
  43. function eventNewGame()
  44. blue = '#'
  45. green = '#'
  46. blue = {}
  47. green = {}
  48.  
  49. vivos = #jogadores
  50. start=false
  51.  
  52. for i,v in pairs(jogadores) do
  53. data[i].haveTeam=false
  54. tfm.exec.setNameColor(v[1], 0xFFFFFF)
  55. if v[2] then
  56. v[2] = false
  57. end
  58. end
  59. end
  60.  
  61. function eventLoop(elapsed, remaining)
  62. if elapsed >= 2000 and not start then
  63. maxT = math.floor(vivos/2)
  64. if #blue < maxT then
  65. jogador = jogadores[math.random(#jogadores)]
  66. if not jogador[2] then
  67. table.insert(blue,jogador[1])
  68. jogador[2] = true
  69. data[jogador[1]].haveTeam=true
  70. end
  71. elseif #green < maxT then
  72. jogador = jogadores[math.random(#jogadores)]
  73. if not jogador[2] then
  74. table.insert(green,jogador[1])
  75. jogador[2] = true
  76. data[jogador[1]].haveTeam=true
  77. end
  78. end
  79.  
  80. for all,v in pairs(tfm.get.room.playerList) do
  81. if not v.isDead then
  82. if not data[all].haveTeam then
  83. teams={blue,green}
  84.  
  85. table.insert(teams[math.random(#teams)],jogador[1])
  86. jogador[2] = true
  87. data[jogador[1]].haveTeam=true
  88. end
  89. end
  90. end
  91. end
  92.  
  93. if elapsed >= 3000 and not start then
  94. start = true
  95. changeColor();
  96. end
  97. end
  98.  
  99. function changeColor()
  100. for i,v in pairs(blue) do
  101. tfm.exec.setNameColor(v, 0x1E90FF)
  102. end
  103.  
  104. for i,v in pairs(green) do
  105. tfm.exec.setNameColor(v, 0x1bd428)
  106. end
  107. end
  108.  
  109. for all in pairs(tfm.get.room.playerList) do
  110. eventNewPlayer(all)
  111. end
  112.  
  113. function eventTextAreaCallback(id, name, link)
  114. if link == "close_help" then
  115. for id = 0,6 do
  116. ui.removeTextArea(id, name)
  117. end
  118. end
  119. if link == "open_help" then
  120. ui.addTextArea(0, "\n\n\n\n<p align=\"center\"><N><font size=\"16\">Oieee , Sejam todos bem vindos ao <B>PokéViper</B> novo module , para jogar e muito simples você será de 1 time azul ou verde seu objetivo e pega a Pokébolla do outro lá do campo ... Mais cuidado lembre-se isso é 1 jogo de pokémon poderes vão ter !!!", name, 226, 126, 383, 201, 0x172a33, 0x000000, 1, true)ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  121. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  122. ui.addTextArea(2, "<a href='event:close_help'><font size=\"15\"><B><font color=\"#b50909\">X", name, 587, 127, 21, 25, 0xb50909, 0x000000, 0, true)
  123. ui.addTextArea(3, "<font size=\"20\"><a href='event:open_credits'><font size=\"20\"><p align=\"center\">Creditos</a>", name, 260, 126, 100, 36, 0x1bd428, 0x000000, 0, true)
  124. ui.addTextArea(4, "<font size=\"20\"><a href='event:open_shop'><font size=\"20\"><p align=\"center\">Shop</a>", name, 475, 127, 100, 36, 0x1bd428, 0x000000, 0, true)
  125. ui.addTextArea(5, "<a href='event:open_help'><font size=\"20\"><p align=\"center\"><VP>Help</a>", name, 367, 126, 100, 47, 0x324650, 0x000000, 0, true)
  126. end
  127. if link == "open_credits" then
  128. ui.addTextArea(0, "\n\n\n\n<p align=\"center\"><font size=\"16\"><B>Donos(as)\n</B><CE>Sexfemm</CE>\n<B>Sub Donos(as)\n</B><CE>Rianmojang1</CE>\n<B>Avaliadores(as)</B>\n<CE>Julodinho, Onoratolima, Dudugontijo\n", name, 226, 126, 383, 220, 0x172a33, 0x000000, 1, true)
  129. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  130. ui.addTextArea(2, "<a href='event:close_help'><font size=\"15\"><B><font color=\"#b50909\">X", name, 587, 127, 21, 25, 0xb50909, 0x000000, 0, true)
  131. ui.addTextArea(4, "<font size=\"20\"><a href='event:open_credits'><font size=\"20\"><p align=\"center\"><VP>Creditos</a>", name, 260, 126, 100, 36, 0x1bd428, 0x000000, 0, true)
  132. ui.addTextArea(5, "<font size=\"20\"><a href='event:open_shop'><font size=\"20\"><p align=\"center\">Shop</a>", name, 475, 127, 100, 36, 0x1bd428, 0x000000, 0, true)
  133. ui.addTextArea(6, "<a href='event:open_help'><font size=\"20\"><p align=\"center\">Help</a>", name, 367, 126, 100, 47, 0x324650, 0x000000, 0, true)
  134. end
  135. end
  136.  
  137. function eventChatCommand(name, cmd)
  138. if cmd == "help" then
  139. ui.addTextArea(0, "\n\n\n\n<p align=\"center\"><N><font size=\"16\">Oieee , Sejam todos bem vindos ao <B>PokéViper</B> novo module , para jogar e muito simples você será de 1 time azul ou verde seu objetivo e pega a Pokébolla do outro lá do campo ... Mais cuidado lembre-se isso é 1 jogo de pokémon poderes vão ter !!!", name, 226, 126, 383, 201, 0x172a33, 0x000000, 1, true)ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  140. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  141. ui.addTextArea(2, "<a href='event:close_help'><font size=\"15\"><B><font color=\"#b50909\">X", name, 587, 127, 21, 25, 0xb50909, 0x000000, 0, true)
  142. ui.addTextArea(3, "<font size=\"20\"><a href='event:open_credits'><font size=\"20\"><p align=\"center\">Creditos</a>", name, 260, 126, 100, 36, 0x1bd428, 0x000000, 0, true)
  143. ui.addTextArea(4, "<font size=\"20\"><a href='event:open_shop'><font size=\"20\"><p align=\"center\">Shop</a>", name, 475, 127, 100, 36, 0x1bd428, 0x000000, 0, true)
  144. ui.addTextArea(5, "<a href='event:open_help'><font size=\"20\"><p align=\"center\"><VP>Help</a>", name, 367, 126, 100, 47, 0x324650, 0x000000, 0, true)
  145. end
  146. end
  147.  
  148. function eventKeyboard(name, key, down, x, y)
  149. if key == 32 and not tfm.get.room.playerList[name].isDead and data[name].time_shoot < os.time()-1000 then
  150. if tfm.get.room.playerList[name].isFacingRight then
  151. tfm.exec.addShamanObject(1704,x+20,y,90,-20)
  152. else
  153. tfm.exec.addShamanObject(1704,x-20,y,270,-20)
  154. end
  155.  
  156. data[name].time_shoot=os.time();
  157. end
  158. end
  159.  
  160. tfm.exec.newGame(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement