Advertisement
Dudugz-Contistente

Untitled

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