Advertisement
Dudugz-Contistente

Untitled

Aug 21st, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.00 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[v[1]].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. local teams={'blue','green','green','blue','blue','green','green','blue'}
  81. local team=nil
  82. local jogador=nil
  83.  
  84. for i,jogador in pairs(jogadores) do
  85. team=teams[math.random(#teams)]
  86. if not jogador[2] then
  87. if team == 'blue' then
  88. table.insert(blue,jogador[1])
  89. elseif team == 'green' then
  90. table.insert(green,jogador[1])
  91. end
  92.  
  93. jogador[2] = true
  94. data[jogador[1]].haveTeam=true
  95. end
  96. end
  97. end
  98.  
  99. if elapsed >= 3000 and not start then
  100. start = true
  101. changeColor();
  102. end
  103. end
  104.  
  105. function changeColor()
  106. for i,v in pairs(blue) do
  107. tfm.exec.setNameColor(v, 0x1E90FF)
  108. end
  109.  
  110. for i,v in pairs(green) do
  111. tfm.exec.setNameColor(v, 0x1bd428)
  112. end
  113. end
  114.  
  115. for all in pairs(tfm.get.room.playerList) do
  116. eventNewPlayer(all)
  117. end
  118.  
  119. function eventTextAreaCallback(id, name, link)
  120. if link == "close_help" then
  121. for id = 0,6 do
  122. ui.removeTextArea(id, name)
  123. end
  124. end
  125. if link == "open_help" then
  126. 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)
  127. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  128. 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)
  129. 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)
  130. 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)
  131. 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)
  132. end
  133. if link == "open_credits" then
  134. 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)
  135. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  136. 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)
  137. 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)
  138. 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)
  139. 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)
  140. end
  141. end
  142.  
  143. function eventChatCommand(name, cmd)
  144. if cmd == "help" then
  145. 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)
  146. ui.addTextArea(1, "<font color=\"#FFFFFF\">______________________________________________", name, 260, 145, 347, 22, 0x324650, 0x000000, 0, true)
  147. 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)
  148. 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)
  149. 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)
  150. 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)
  151. end
  152. end
  153.  
  154. function eventKeyboard(name, key, down, x, y)
  155. if key == 32 and not tfm.get.room.playerList[name].isDead and data[name].time_shoot < os.time()-1000 then
  156. if tfm.get.room.playerList[name].isFacingRight then
  157. tfm.exec.addShamanObject(1704,x+20,y,90,-20)
  158. else
  159. tfm.exec.addShamanObject(1704,x-20,y,270,-20)
  160. end
  161.  
  162. data[name].time_shoot=os.time();
  163. end
  164. end
  165.  
  166. tfm.exec.newGame(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement