Advertisement
JessiewindScripts

Anvilwar 5020.055

Jul 16th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 41.41 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoScore(true)
  4. tfm.exec.disableAfkDeath(true)
  5. tfm.exec.disableAutoTimeLeft(true)
  6. tfm.exec.disableDebugCommand(true)
  7. tfm.exec.disablePhysicalConsumables(true)
  8. tfm.exec.disableMortCommand(true)
  9. powerups={double=false,chuva=false,count=0,choosed="",bomba=false,objeto=false,explosion=false,fly=false,triple=false,invisible=false,selective=false}
  10. play_azul={}
  11. objetos={1,2,3,4,6,7,10,23,32,34,35,39,45,46,54,60,61,62,65,67,68,69,89,90,95}
  12. play_vermelho={}
  13. scoreloop=0
  14. sudden_death=false
  15. actual_player=""
  16. tempo=0
  17. players=0
  18. time_limit=10
  19. team=1
  20. kills=0
  21. data={}
  22. loop=8
  23. power=5
  24. valendo=false
  25. anvil_launched=false
  26. set=false
  27. object=10
  28. set_name=""
  29. reset=false
  30. count=0
  31. count_azul=0
  32. count_vermelho=0
  33. system.disableChatCommandDisplay("help")
  34. system.disableChatCommandDisplay("powerups")
  35. system.disableChatCommandDisplay("set")
  36. system.disableChatCommandDisplay("tc")
  37. system.disableChatCommandDisplay("limit")
  38. system.disableChatCommandDisplay("msg")
  39. system.disableChatCommandDisplay("p")
  40. system.disableChatCommandDisplay("rank")
  41. anvils={10,1002,1003,1004,1005}
  42. mapas={"@7467262","@7463118","@7436867","@7412348","@7467977","@7470456"}
  43. lang = {}
  44. lang.br = {
  45.     win_vermelho = "<R><b>GG Time Vermelho!</b><br>A próxima partida será iniciada em 15 segundos.",
  46.     win_azul = "<BL><b>GG Time Azul!</b><br>A próxima partida será iniciada em 15 segundos.",
  47.     sudden_death = "<VP><b>Morte Súbita!</b><br>A equipe que conseguir eliminar qualquer um adversário será declarada a vencedora.",
  48.     empate_text = "<J><b>Houve um empate!</b><br>A próxima partida será iniciada em 15 segundos.",
  49.     instructions = "Use as teclas de 1 a 9 para alterar a potência da bigorna e barra de espaço para atirar. Para ajuda digite !help. Para ver poderes especiais digite !powerups.",
  50.     turn = "<VP>É a vez de",
  51.     timeout = "<J>Tempo esgotado! O atirador será alterado.",
  52.     enter_vermelho = "Entrar no time vermelho",
  53.     enter_azul = "Entrar no time azul",
  54.     exit = "Sair do time",
  55.     double = "acionou o powerup Bigorna Dupla!",
  56.     double2 = "<br>Neste powerup, você atira 2 bigornas de uma vez.",
  57.     triple = "acionou o powerup Bigorna Tripla!",
  58. triple2 = "<br>Neste powerup, você atira 3 bigornas de uma vez.",
  59.     bomba1 = "acionou o powerup Bomba Relógio!",
  60.     bomba2 = "<br>Neste powerup, uma explosão em um lugar aleatório do time adversário ocorrerá.",
  61.     objeto1 = "acionou o powerup Tiro Aleatório!",
  62.     objeto2 = "<br>Neste powerup, ao pressionar a barra de espaço, você vai atirar um objeto aleatório de shaman. Caso você tenha usado a habilidade Bigorna Dupla, você irá atirar 2 objetos ao invés de um.",
  63.     exp1 = "acionou o powerup Olha a Explosão!",
  64.     exp2 = "<br>Neste powerup, você pode gerar uma explosão clicando em um local do time inimigo.<br>Você possui 5 segundos para explodir!",
  65.     chuva1 = "acionou o powerup Chuva de Objetos!",
  66.     chuva2 = "<br>Neste powerup, ao atirar uma bigorna, irão aparecer diversos objetos continuamente até a troca de jogador.",
  67.     fly1 = "acionou o powerup Modo Teleport!",
  68.     fly2 = "<br>Neste powerup, enquanto você não atira uma bigorna, você poderá se teleportar clicando com o mouse.",
  69.     inv1 = "acionou o powerup Modo Imortal!",
  70.     inv2 = "<br>Neste powerup, você ficará imortal durante 4 turnos do seu time. Esta habilidade só pode ser utilizada uma vez por partida.",
  71.     inv3 = "Sua habilidade Modo Imortal expirou.",
  72.     invi1 = "acionou o powerup Bigorna Invisível!",
  73.     invi2 = "<br>Neste powerup, você vai atirar uma bigorna invisível.<br>Este powerup não pode ser usado com as bigornas duplas e triplas.",
  74.     selec1 = "acionou o powerup Objeto Seletivo!",
  75.     selec2 = "<br>Neste powerup, você pode escolher um objeto para atirar ao invés de uma bigorna. Os preços variam de acordo com o objeto selecionado.",
  76.     bar = "#anvilwar - Sala Temporária em Execução - Compilação 5020.055 efetuada em 16/07/2018<",
  77.     intensity = "Intensidade",
  78.     your_turn = "<J>É a sua vez de jogar. Pressione ESPAÇO para atirar e use as teclas de 1 a 9 para alterar a potência da bigorna. Use as teclas F1 a F10 para usar poderes especiais.",
  79.     help = "Pressione ESPAÇO para atirar e use as teclas de 1 a 9 para alterar a potência da bigorna. Use as teclas de F1 a F10 para usar poderes especiais (para saber quais são, digite !powerups). A equipe que conseguir eliminar todos do time adversário vencerá a partida.<br><br>Script criado por Jessiewind26#2546, Jarvanfender#0000 e Jhinsword350#0000. Créditos a Vidaloka9999#0000 e Arenaut2000#0000 (tradução para o inglês).",
  80.     enter = "Bem-vindos ao module Guerra de Bigornas! Digite !help para maiores informações.",
  81.     teamkill1 = "Oh não! ",
  82.     teamKill2 = "matou um companheiro de equipe",
  83.     ajuda = "Ajuda",
  84.     credits = "Créditos",
  85.     mostrar = "Mostrar",
  86.     seconds = "<ROSE>Faltam 60 segundos!",
  87.     seconds30 = "<ROSE>Faltam 30 segundos!",
  88.     seconds10 = "<ROSE>Faltam 10 segundos!",
  89.     powerups1 = "F1 = Bigorna Dupla<br>F2 = Bigorna Tripla<br>F3 = Bomba Relógio<br>F4 = Tiro Aleatório<br>F5 = Olha a Explosão<br>F6 = Chuva de Objetos<br>F7 = Modo Teleport<br>F8 = Modo Imortal<br>F9 = Bigorna Invisível<br>F10 = Objeto Seletivo",
  90.     powerups2 = "5pts<br>9pts<br>7pts<br>6pts<br>22pts<br>18pts<br>6pts<br>20pts<br>25pts<br>5pts",
  91.     powerups3 = "<a href='event:power1'>Mostrar</a><br><a href='event:power2'>Mostrar</a><br><a href='event:power3'>Mostrar</a><br><a href='event:power4'>Mostrar</a><br><a href='event:power5'>Mostrar</a><br><a href='event:power6'>Mostrar</a><br><a href='event:power7'>Mostrar</a><br><a href='event:power8'>Mostrar</a><br><a href='event:power9'>Mostrar</a><br><a href='event:power10'>Mostrar</a>",
  92.     teamchat = "<J>Você pode usar o comando !tc [mensagem] para falar apenas com o seu time.<br><br>Você pode ver seu perfil no jogo digitando !p e o ranking temporário digitando !rank.",
  93.     menu_bar = "<p align='center'><a href='event:help'>Ajuda</a>  |  <a href='event:powerups'>Powerups</a>  |  <a href='event:profile'>Perfil</a>  |  <a href='event:ranking'>Ranking</a>",
  94.     powerupslist = "Lista de Poderes",
  95.     profile = "Use o comando !p para ver o seu perfil. Use !p [nome] para ver o perfil de outra pessoa.",
  96.     starting = "<VP>A partida está prestes a começar. Preparem-se!"
  97. }
  98. lang.en = {
  99.     win_vermelho = "<R><b>The RED team wins!</b><br>The next match will start on 15 seconds.",
  100.     win_azul = "<BL><b>The BLUE team wins!</b><br>The next match will start on 15 seconds.",
  101.     sudden_death = "<VP><b>SUDDEN DEATH!</b><br>The team that kill anyone of other team will won the match.",
  102.     empate_text = "<J><b>There was a draw!</b><br>The next match will start on 15 seconds.",
  103.     instructions = "Use the 1 to 9 keys to change the intensity of anvil and SPACEBAR to throw a anvil.",
  104.     turn = "<VP>It's turn of",
  105.     timeout = "<J>Time is over! The shooter will be changed.",
  106.     enter_vermelho = "Enter on RED team",
  107.     enter_azul = "Enter on BLUE team",
  108.     exit = "Leave this team",
  109.     double = "used the powerup Double Anvil!",
  110.     triple = "used the powerup Triple Anvil!",
  111.     bomba1 = "used the powerup Time Bomb!",
  112.     bomba2 = "<br>On this powerup, a explosion will occur on a random place of enemy area.",
  113.     objeto1 = "used the powerup Random Shoot!",
  114.     objeto2 = "<br>On this powerup, you will shoot a random shaman object instead of a anvil. If you have used the Double Anvil powerup, you can shoot 2 objects instead of one.",
  115.     exp1 = "used the powerup Explosion!",
  116.     exp2 = "<br>On this powerup, you can cause a explosion clicking on enemy area with your mouse.<br>You have 5 seconds to cause your explosion.",
  117.     chuva1 = "used the powerup Anvil Rain!",
  118.     chuva2 = "<br>On this powerup, you will shoot several anvils",
  119.     fly1 = "used the powerup Teleport Mode!",
  120.     fly2 = "<br>On this powerup, you can teleport your mice using the mouse click.",
  121.     inv1 = "used the powerup Immortal Mode!",
  122.     inv2 = "<br>On this powerup, you be immortal during the next 4 turns. This powerup only can be used 1 time per game.",
  123.     inv3 = "Your immortality has ended.",
  124.     invi1 = "used the powerup Invisible Anvil!",
  125.     invi2 = "<br>On this powerup, you will shoot a invisible anvil. This ability can't be used with double and triple anvils.",
  126.     selec1 = "used the powerup Selective Object!",
  127.     selec2 = "<br>On this powerup, you can select a shaman object to shoot instead of a anvil. This ability can't be used with double and triple anvils.",
  128.     bar = "#anvilwar - Temporary Module Running - Compilation 5020.055 made on 07/16/2018<",
  129.     intensity = "Intensity",
  130.     your_turn = "<J>It's your turn to shoot. Press SPACEBAR to throw a anvil and use the 1 to 9 keys to change the intensity of anvil. Use the F1 to F10 keys to use powerups.",
  131.     help = "Press SPACEBAR to throw a anvil and use the 1 to 9 keys to change the intensity of anvil. Use the F1 to F10 keys to use powerups (type !powerups). The team that eliminates the enemy team wons the game.<br><br>Script made by Jessiewind26#2546, Jarvanfender#0000 e Jhinsword350#0000. Credits to Vidaloka9999#0000 and Arenaut2000#0000 (English translation).",
  132.     enter = "Welcome to Anvil War Module! Type !help to help.",
  133.     teamkill1 = "Oh no! ",
  134.     teamKill2 = "has killed a player of her team",
  135.     seconds = "<ROSE>60 seconds remaining!",
  136.     seconds30 = "<ROSE>30 seconds remaining!",
  137.     seconds10 = "<ROSE>10 seconds remaining!",
  138.     powerups1 = "F1 = Double Anvil<br>F2 = Triple Anvil<br>F3 = Time Bomb<br>F4 = Random Shoot<br>F5 = Explosion<br>F6 = Anvil Rain<br>F7 = Teleport Mode<br>F8 = Immortal Mode<br>F9 = Invisible Anvil<BR>F10 = Selective Object",
  139.     powerups2 = "5pt<br>9pt<br>7pt<br>6pt<br>22pt<br>18pt<br>6pt<br>20pt<br>25pt<br>5pt",
  140.     powerups3 = "<a href='event:power1'>Show</a><br><a href='event:power2'>Show</a><br><a href='event:power3'>Show</a><br><a href='event:power4'>Show</a><br><a href='event:power5'>Show</a><br><a href='event:power6'>Show</a><br><a href='event:power7'>Show</a><br><a href='event:power8'>Show</a><br><a href='event:power9'>Show</a><br><a href='event:power10'>Show</a>",
  141.     teamchat = "<J>You can use the command !tc [message] to speak with your team.<br><br>You can see your profile typing !p and the temporary tanking typing !rank.",
  142.     menu_bar = "<p align='center'><a href='event:help'>Help</a>  |  <a href='event:powerups'>Powerups</a>  |  <a href='event:profile'>Profile</a>  |  <a href='event:ranking'>Ranking</a>",
  143.     powerupslist = "Powerups List",
  144.     profile = "Use the !p command to view your profile and use !p [username] to view the profile of another user.",
  145.     starting = "<VP>The match will start on a few seconds. Get ready!"
  146. }
  147. if tfm.get.room.community == "br" then
  148.     text = lang.br
  149. else
  150.     text = lang.en
  151. end
  152.  
  153. function changeMap()
  154.     tfm.exec.newGame(mapas[math.random(#mapas)])
  155. end
  156. function resetPowers()
  157.     ui.removeTextArea(701,nil)
  158.     powerups.double=false
  159.     powerups.objeto=false
  160.     powerups.count=2
  161.     kills=0
  162.     powerups.bomba=false
  163.     powerups.explosion=false
  164.     powerups.chuva=false
  165.     powerups.fly=false
  166.     anvil_launched=false
  167.     powerups.triple=false
  168.     powerups.invisible=false
  169.     powerups.selective=false
  170.     set=false
  171. end
  172. changeMap()
  173. function split(t,s)
  174. local a={}
  175. for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
  176.     table.insert(a,i)
  177. end
  178. return a
  179. end
  180. function eventRanking(name)
  181.     local sc = {}
  182.     for name, player in pairs(tfm.get.room.playerList) do
  183.         sc[#sc+1] = {n=name,s=data[name].score,f=data[name].kills,d=data[name].kd}
  184.     end
  185.    
  186.     table.sort(sc,function(a,b) return a.s>b.s end)
  187.  
  188.     str1 = ''
  189.         str2 = ''
  190.         str3 = ''
  191.         str4 = ''
  192.     for k,v in pairs(sc) do
  193.         if k < 13 then
  194.             if str ~= '' then
  195.                 str1=str1.."<br><N>"..k.."° | <VP>"..v.n..""
  196.                     str2=str2.."<br><b><N>"..v.s.."</b>"
  197.                     str3=str3.."<br><N>"..v.f..""
  198.                     str4=str4.."<br><N>"..v.d..""
  199.             else
  200.                 str1="<J>"..k.."° | <VP>"..v.n..""
  201.                     str2="<J><b>"..v.s.."</b>"
  202.                     str3="<J>"..v.f..""
  203.                     str4="<J>"..v.d..""
  204.             end
  205.         end
  206.     end
  207.     ui.addTextArea(8000,'<B><J><font size="13"><p align="center">Ranking of Day',name,100,60,600,30,nil,0x2e424d,nil,true)
  208.     ui.addTextArea(8001,"<B><font size='13'><font face='Consolas'>#      Name                                      Score        Kills      Ratio%",name,110,90,580,20,0x0e232b,0x0e232b,nil,true)
  209.     ui.addTextArea(8002,"<B><font size='16'><font face='Consolas'>"..str1,name,110,110,580,240,0x0e232b,0x0e232b,nil,true)
  210.     ui.addTextArea(8003,"<p align='right'><font size='16'><font face='Consolas'>"..str2,name,420,110,60,240,0x0e232b,0x0e232b,nil,true)
  211.     ui.addTextArea(8004,"<p align='right'><font size='16'><font face='Consolas'>"..str3,name,500,110,60,240,0x0e232b,0x0e232b,nil,true)
  212.     ui.addTextArea(8005,"<p align='right'><font size='16'><font face='Consolas'>"..str4,name,610,110,45,240,0x0e232b,0x0e232b,nil,true)
  213.     ui.addTextArea(8006,"<p align='center'><font size='15'><R><a href='event:close'>Close</a>",name,300,360,190,20,0x3c5063,0x3c5063,nil,true)
  214. end
  215. function loadPowerups(name)
  216.     ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.powerupslist.."",name,100,60,600,30,nil,0x2e424d,nil,true)
  217.     ui.addTextArea(9001,"<font size='14'><font face='Consolas'>Powerup Name                          Score     Funct.",name,110,90,580,20,0x0e232b,0x0e232b,nil,true)
  218.     ui.addTextArea(9002,"<font size='14'><font face='Consolas'>"..text.powerups1.."",name,110,115,580,250,0x0e232b,0x0e232b,nil,true)
  219.     ui.addTextArea(9003,"<font size='14'><font face='Consolas'>"..text.powerups2.."",name,420,115,60,250,0x0e232b,0x0e232b,nil,true)
  220.     ui.addTextArea(9004,"<font size='14'><font face='Consolas'>"..text.powerups3.."",name,500,115,60,250,0x0e232b,0x0e232b,nil,true)
  221.     ui.addTextArea(9006,"<font size='14'><R><a href='event:closep'>Close</a>",name,300,360,190,20,0x3c5063,0x3c5063,nil,true)
  222. end
  223. function eventChatCommand(name,message)
  224.     local arg = split(message, " ")
  225.     if arg[1] == "p" then
  226.         if arg[2] then
  227.             nome = arg[2]:lower():gsub('%a', string.upper, 1)
  228.         else
  229.             nome = name
  230.         end
  231.        
  232.         if tfm.get.room.playerList[nome] then
  233.                 ui.addTextArea(8003,'<B><J><font size="17"><p align="center">'..nome,name,245,65,315,30,nil,0x2e424d,nil,true)
  234.                 ui.addTextArea(8004,"<font size='12'><b>Score: "..data[nome].score.."</b><br><br>Matchs played: "..data[nome].matchs.."<br>Kills: "..data[nome].kills.."<br>Wins: "..data[nome].wins.."<br>Max Killing Spree: "..data[nome].max.."<br>Multi Kills: "..data[nome].mks.."<br>Kills/Match: "..data[nome].kd.."%",name,255,95,290,120,0x0e232b,0x0e232b,nil,true)
  235.                 ui.addTextArea(8005,"<R><p align='center'><B><a href='event:fechar'>Fechar</a>",name,255,220,290,20,0x3c5063,0x3c5063,nil,true)
  236.     else
  237.                 tfm.exec.chatMessage("<R>"..nome.." isn't found in this room.</R>",name)
  238.     end
  239.     end
  240.  
  241.     if message == "rank" then
  242.     eventRanking(name)
  243. end
  244.     if(message:sub(0,4) == "kill") then
  245.         if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
  246.             tfm.exec.killPlayer(message:sub(6))
  247.         end
  248.     end
  249.     if(message:sub(0,7) == "set_map") then
  250.         if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
  251.             tfm.exec.newGame(message:sub(9))
  252.         end
  253.     end
  254.     if(message:sub(0,5) == "limit") then
  255.         if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
  256.             local limite=tonumber(message:sub(7))
  257.             tfm.exec.chatMessage("Room mice limit: "..limite.."")
  258.             tfm.exec.setRoomMaxPlayers(limite)
  259.         end
  260.     end
  261.     if(message:sub(0,2) == "tc") then
  262.         local typer=name
  263.             if data[typer].team == "azul" then
  264.                 for name,player in pairs(tfm.get.room.playerList) do
  265.                     if data[name].team == "azul" then
  266.                         tfm.exec.chatMessage("<font color='#0080ff'>• ["..typer.."] "..message:sub(4).."",name)
  267.                     end
  268.                 end
  269.             elseif data[typer].team == "vermelho" then
  270.                 for name,player in pairs(tfm.get.room.playerList) do
  271.                     if data[name].team == "vermelho" then
  272.                         tfm.exec.chatMessage("<font color='#ff8000'>• ["..typer.."] "..message:sub(4).."",name)
  273.                     end
  274.                 end
  275.             end
  276.     end
  277.     if message == "reset" then
  278.         if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
  279.             changeMap()
  280.         end
  281.     end
  282.     if(message:sub(0,3) == "set") then
  283.         if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
  284.             set_name=message:sub(5)
  285.             set=true
  286.         end
  287.     end
  288.     if message == "help" then
  289.         tfm.exec.chatMessage(text.help,name)
  290.     end
  291.     if message == "powerups" then
  292.         loadPowerups()
  293.     end
  294. end
  295. function eventLoop(passado,faltando)
  296.     local minutos=math.floor(tempo/60)
  297.     local segundos=math.floor((minutos*60)-tempo) * -1
  298.     if valendo == true and tempo < 60 and tempo > 59 and sudden_death == false then
  299.         tfm.exec.chatMessage(text.seconds,nil)
  300.     end
  301.     if valendo == true and tempo < 30 and tempo > 29 and sudden_death == false then
  302.         tfm.exec.chatMessage(text.seconds30,nil)
  303.     end
  304.     if valendo == true and tempo < 10 and tempo > 9 then
  305.         tfm.exec.chatMessage(text.seconds10,nil)
  306.     end
  307.     if valendo == true and reset == false then
  308.         tempo=tempo-0.5
  309.         scoreloop=scoreloop+1
  310.         if scoreloop >= 30 then
  311.             for name,player in pairs(tfm.get.room.playerList) do
  312.                 if data[name].killed == 0 then
  313.                     tfm.exec.setPlayerScore(name,2,true)
  314.                     data[name].score=data[name].score+1
  315.                 end
  316.             end
  317.             scoreloop=0
  318.         end
  319.     end
  320.     if anvil_launched == false and valendo == true then
  321.         ui.addTextArea(501,"<font size='40'><p align='center'>"..math.floor(faltando/1000).."",actual_player,360,310,80,55,0x000001,0x000001,1.0,true)
  322.     else
  323.         ui.removeTextArea(501,actual_player)
  324.     end
  325.     if valendo == true and reset == false and tempo == 0 and sudden_death == true then
  326.         if count_vermelho > count_azul then
  327.             tfm.exec.chatMessage(text.win_vermelho)
  328.         elseif count_vermelho < count_azul then
  329.             tfm.exec.chatMessage(text.win_azul)
  330.         else
  331.             tfm.exec.chatMessage(text.empate_text)
  332.         end
  333.         count_azul=0
  334.         count_vermelho=0
  335.         valendo=false
  336.         reset=true
  337.         tfm.exec.setGameTime(15)
  338.     end
  339.     if reset == true then
  340.         if faltando < 1 then
  341.             changeMap()
  342.         end
  343.     end
  344.     if valendo == true and reset == false and anvil_launched == false then
  345.         time_limit=time_limit-0.5
  346.         if time_limit == 0 then
  347.             anvil_launched=true
  348.             time_limit=15
  349.             tfm.exec.chatMessage(text.timeout)
  350.         end
  351.     end
  352.     if valendo == false and reset == false and faltando < 1888 and count_azul > 0 and count_vermelho > 0 then
  353.         for i=11,297 do
  354.             ui.removeTextArea(i,nil)
  355.         end
  356.     end
  357.     if valendo == false and reset == false and faltando < 1 then
  358.         if count_azul > 0 and count_vermelho > 0 then
  359.             if count == 0 then
  360.             for name,player in pairs(tfm.get.room.playerList) do
  361.                 tfm.exec.chatMessage(text.starting,name)
  362.                 if data[name].team == "azul" then
  363.                     data[name].matchs=data[name].matchs+1
  364.                     tfm.exec.respawnPlayer(name)
  365.                     tfm.exec.movePlayer(name,1000,160,false,0,0,false)
  366.                     table.insert(play_azul,name)
  367.                     tfm.exec.setPlayerScore(name,0,false)
  368.                 elseif data[name].team == "vermelho" then
  369.                     data[name].matchs=data[name].matchs+1
  370.                     tfm.exec.respawnPlayer(name)
  371.                     tfm.exec.movePlayer(name,600,160,false,0,0,false)
  372.                     table.insert(play_vermelho,name)
  373.                     tfm.exec.setPlayerScore(name,0,false)
  374.                 else
  375.                     tfm.exec.movePlayer(name,800,-1,false,0,0,false)
  376.                     tfm.exec.setPlayerScore(name,-1,false)
  377.                     kills=0
  378.                 end
  379.             end
  380.             end
  381.             kills=0
  382.             count=count+0.5
  383.             if count >= 10 then
  384.             tfm.exec.chatMessage(text.teamchat,nil)
  385.             valendo=true
  386.             players=count_azul+count_vermelho
  387.             tempo=120+(players*8)
  388.             for i=11,297 do
  389.                 ui.removeTextArea(i,nil)
  390.             end
  391.             if team == 2 then
  392.                 team=1
  393.                 if set == false then
  394.                     actual_player=play_vermelho[math.random(#play_vermelho)]
  395.                 else
  396.                     actual_player=set_name
  397.                 end
  398.             else
  399.                 team=2
  400.                 if set == false then
  401.                     actual_player=play_azul[math.random(#play_azul)]
  402.                 else
  403.                     actual_player=set_name
  404.                 end
  405.             end
  406.             loop=10
  407.             anvil_launched=false
  408.             tfm.exec.setGameTime(15)
  409.             time_limit=15
  410.             if valendo == true and reset == false then
  411.                 tfm.exec.chatMessage(text.your_turn,actual_player)
  412.             end
  413.             end
  414.         else
  415.             tfm.exec.setGameTime(6)
  416.         end
  417.     end
  418.     if valendo == true and anvil_launched == true then
  419.         loop=loop-1
  420.         if loop == 0 then
  421.             if kills >= 3 then
  422.                 data[actual_player].mks=data[actual_player].mks+1
  423.             end
  424.             if not tfm.get.room.community == "br" then
  425.                 if kills == 2 then
  426.                     tfm.exec.chatMessage("<ROSE>Double Kill of "..actual_player.."!")
  427.                 elseif kills >= 3 then
  428.                     tfm.exec.chatMessage("<ROSE>Multi Kill: "..kills.." kills of "..actual_player.."!")
  429.                 end
  430.             else
  431.                 if kills == 2 then
  432.                     tfm.exec.chatMessage("<ROSE>Double Kill de "..actual_player.."!")
  433.                 elseif kills >= 3 then
  434.                     tfm.exec.chatMessage("<ROSE>Multi Kill: "..kills.." kills de "..actual_player.."!")
  435.                 end
  436.             end
  437.             kills=0
  438.             play_azul={}
  439.             play_vermelho={}
  440.             count_azul=0
  441.             count_vermelho=0
  442.             for name,player in pairs(tfm.get.room.playerList) do
  443.                 if data[name].team == "azul" then
  444.                     if data[name].killed == 0 then
  445.                         table.insert(play_azul,name)
  446.                         count_azul=count_azul+1
  447.                     end
  448.                 end
  449.                 if data[name].team == "vermelho" then
  450.                     if data[name].killed == 0 then
  451.                         table.insert(play_vermelho,name)
  452.                         count_vermelho=count_vermelho+1
  453.                     end
  454.                 end
  455.                 if data[name].immortal == true then
  456.                     data[name].imatchs=data[name].imatchs+1
  457.                     if data[name].imatchs >= 9 then
  458.                         data[name].immortal=false
  459.                         tfm.exec.chatMessage(text.inv3,name)
  460.                         tfm.exec.setNameColor(name,0xd7d7e6)
  461.                     end
  462.                 end
  463.             end
  464.             if team == 2 then
  465.                 team=1
  466.                 if set == false then
  467.                     actual_player=play_vermelho[math.random(#play_vermelho)]
  468.                 else
  469.                     actual_player=set_name
  470.                 end
  471.             else
  472.                 team=2
  473.                 if set == false then
  474.                     actual_player=play_azul[math.random(#play_azul)]
  475.                 else
  476.                     actual_player=set_name
  477.                 end
  478.             end
  479.             loop=8
  480.             resetPowers()
  481.             if valendo == true and reset == false then
  482.                 if count_azul == 0 then
  483.                     winRed()
  484.                     tfm.exec.chatMessage(text.win_vermelho)
  485.                     valendo=false
  486.                     reset=true
  487.                     tfm.exec.setGameTime(15)
  488.                 elseif count_vermelho == 0 then
  489.                     winAzul()
  490.                     tfm.exec.chatMessage(text.win_azul)
  491.                     valendo=false
  492.                     reset=true
  493.                     tfm.exec.setGameTime(15)
  494.                 end
  495.             end
  496.             tfm.exec.setGameTime(15)
  497.             time_limit=15
  498.             if valendo == true and reset == false then
  499.                 tfm.exec.chatMessage(text.your_turn,actual_player)
  500.             end
  501.         end
  502.     end
  503.     if valendo == true and reset == false and tempo <= 0 and sudden_death == false and anvil_launched == false then
  504.             if count_vermelho > count_azul then
  505.                 tfm.exec.chatMessage(text.win_vermelho)
  506.                 winRed()
  507.                 valendo=false
  508.                 reset=true
  509.                 tfm.exec.setGameTime(15)
  510.                 count_azul=0
  511.                 count_vermelho=0
  512.             elseif count_vermelho < count_azul then
  513.                 tfm.exec.chatMessage(text.win_azul)
  514.                 winAzul()
  515.                 valendo=false
  516.                 reset=true
  517.                 tfm.exec.setGameTime(15)
  518.                 count_azul=0
  519.                 count_vermelho=0
  520.             else
  521.                 tempo=60
  522.                 tfm.exec.setGameTime(60)
  523.                 tfm.exec.chatMessage(text.sudden_death)
  524.                 sudden_death=true
  525.             end
  526.     end
  527.     if powerups.bomba == true then
  528.         powerups.count=powerups.count+1
  529.         if powerups.count == 3 then
  530.             local x_position=0
  531.             if data[actual_player].team == "azul" then
  532.                 x_position=math.random(100,750)
  533.                 tfm.exec.explosion(x_position,200,30,120,true)
  534.                 tfm.exec.displayParticle(12,x_position,200,0,0,0,0,nil)
  535.             elseif data[actual_player].team == "vermelho" then
  536.                 x_position=math.random(850,1500)
  537.                 tfm.exec.explosion(x_position,200,30,120,true)
  538.                 tfm.exec.displayParticle(12,x_position,200,0,0,0,0,nil)
  539.             end
  540.             powerups.count=2
  541.             powerups.bomba=false
  542.         end
  543.     end
  544.     if powerups.chuva == true and anvil_launched == true then
  545.         if data[actual_player].team == "azul" then
  546.             tfm.exec.addShamanObject(anvils[math.random(#anvils)],tfm.get.room.playerList[actual_player].x,tfm.get.room.playerList[actual_player].y-60,0,(4+power*2)*-1,-8)
  547.         elseif data[actual_player].team == "vermelho" then
  548.             tfm.exec.addShamanObject(anvils[math.random(#anvils)],tfm.get.room.playerList[actual_player].x,tfm.get.room.playerList[actual_player].y-60,0,4+power*2,-8)
  549.         end
  550.     end
  551.     if faltando < 15000 and faltando > 10000 and valendo == true and reset == false then
  552.         if segundos < 10 then
  553.             ui.addTextArea(14,"<p align='center'><font size='16'><font face='Consolas'>Time Remaining: <b>"..minutos..":0"..segundos.."</b>  |  Red <R>"..count_vermelho.." <N>X <BL>"..count_azul.." <N>Blue  |  Turn: <b>"..actual_player.."",nil,10,368,780,27,0x241224,0x160916,1.0,true)
  554.         else
  555.             ui.addTextArea(14,"<p align='center'><font size='16'><font face='Consolas'>Time Remaining: <b>"..minutos..":"..segundos.."</b>  |  Red <R>"..count_vermelho.." <N>X <BL>"..count_azul.." <N>Blue  |  Turn: <b>"..actual_player.."",nil,10,368,780,27,0x241224,0x160916,1.0,true)
  556.         end
  557.     else
  558.         ui.removeTextArea(14,nil)
  559.     end
  560. end
  561. function eventPlayerDied(name)
  562.     if count < 10 then
  563.         tfm.exec.respawnPlayer(name)
  564.         if data[name].team == "azul" then
  565.             tfm.exec.movePlayer(name,1000,160,false,0,0,false)
  566.         elseif data[name].team == "vermelho" then
  567.             tfm.exec.movePlayer(name,600,160,false,0,0,false)
  568.         end
  569.     end
  570.     if data[name].immortal == false then
  571.         if valendo == true and reset == false then
  572.             if tfm.get.room.playerList[name].y > 50 then
  573.                 tfm.exec.setPlayerScore(name,-1,false)
  574.                 tfm.exec.setPlayerScore(actual_player,2,true)
  575.                 data[actual_player].kills=data[actual_player].kills+1
  576.                 data[actual_player].score=data[actual_player].score+5
  577.                 loop=loop+1
  578.                 data[name].killed=1
  579.                 kills=kills+1
  580.                 if kills > data[actual_player].max then
  581.                     data[actual_player].max=kills
  582.                     data[actual_player].score=data[actual_player].score+10
  583.                 end
  584.                 if data[name].team == data[actual_player].team and anvil_launched == true then
  585.                     tfm.exec.chatMessage("<J>"..text.teamkill1..""..actual_player.." "..text.teamKill2..": <b>"..name.."</b>.")
  586.                     tfm.exec.setPlayerScore(actual_player,-4,true)
  587.                     kills=kills-1
  588.                     data[actual_player].kills=data[actual_player].kills-1
  589.                     data[actual_player].score=data[actual_player].score-4
  590.                 end
  591.             end
  592.         end
  593.     else
  594.         tfm.exec.respawnPlayer(name)
  595.         tfm.exec.setNameColor(name,0x00ff00)
  596.         if data[name].team == "azul" then
  597.             tfm.exec.movePlayer(name,1000,160,false,0,0,false)
  598.         elseif data[name].team == "vermelho" then
  599.             tfm.exec.movePlayer(name,600,160,false,0,0,false)
  600.         end
  601.     end    
  602.     if sudden_death == true then
  603.         if data[name].team == "azul" and data[name].immortal == false then
  604.             winRed()
  605.             tfm.exec.chatMessage(text.win_vermelho)
  606.             count_azul=0
  607.         elseif data[name].team == "vermelho" and data[name].immortal == false then
  608.             winAzul()
  609.             tfm.exec.chatMessage(text.win_azul)
  610.             count_vermelho=0
  611.         end
  612.         valendo=false
  613.         reset=true
  614.         tfm.exec.setGameTime(15)
  615.         sudden_death=false     
  616.     end
  617.     if actual_player == name then
  618.         anvil_launched=true
  619.         actual_palayer=""
  620.     end
  621. end
  622. function eventPlayerLeft(name)
  623.     ui.setMapName(text.bar)
  624.     data[name].killed=-1
  625.     data[name].team=""
  626. end
  627. function eventNewPlayer(name)
  628.     ui.setMapName(text.bar)
  629.     tfm.exec.chatMessage(text.enter,name)
  630.     if not data[name] then
  631.         data[name]={wins=0,matchs=0,kills=0,max=0,score=0,mks=0,kd=0,killed=-1,team="",immortal=false,imatchs=0,immortal2=false}
  632.     end
  633.     if valendo == false and reset == false then
  634.         ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>", name, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
  635.         ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>", name, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
  636.     end
  637.     for name,player in pairs(tfm.get.room.playerList) do
  638.         ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,24,70,24,0x000001,0x000001,0.75,true)
  639.         for i=32,123 do
  640.             tfm.exec.bindKeyboard(name,i,true,true)
  641.             system.bindMouse(name,true)
  642.         end
  643.     end
  644. end
  645. for name,player in pairs(tfm.get.room.playerList) do
  646.     eventNewPlayer(name)
  647.     tfm.exec.setPlayerScore(name,0,false)
  648. end
  649. function eventKeyboard(name,key,down,x,y)
  650.     if anvil_launched == false then
  651.     if actual_player == name then
  652.     if key == 32 then
  653.         if valendo == true then
  654.             powerups.fly=false
  655.             set=false
  656.             set_name=""
  657.             if powerups.selective == true then
  658.                 if data[name].team == "azul" then
  659.                     tfm.exec.addShamanObject(object,x,y-60,0,(4+power*2)*-1,-8)
  660.                 elseif data[name].team == "vermelho" then
  661.                     tfm.exec.addShamanObject(object,x,y-60,0,4+power*2,-8)
  662.                 end
  663.             end
  664.             if powerups.objeto == true and powerups.selective == false then
  665.                 if data[name].team == "azul" then
  666.                     tfm.exec.addShamanObject(objetos[math.random(#objetos)],x,y-60,0,(4+power*2)*-1,-8)
  667.                 elseif data[name].team == "vermelho" then
  668.                     tfm.exec.addShamanObject(objetos[math.random(#objetos)],x,y-60,0,4+power*2,-8)
  669.                 end
  670.                 if powerups.double == true and powerups.selective == false then
  671.                     if data[name].team == "azul" then
  672.                         tfm.exec.addShamanObject(objetos[math.random(#objetos)],x+40,y-60,0,(4+power*2)*-1,-8)
  673.                     elseif data[name].team == "vermelho" then
  674.                         tfm.exec.addShamanObject(objetos[math.random(#objetos)],x-40,y-60,0,4+power*2,-8)
  675.                     end
  676.                 end
  677.                 if powerups.triple == true and powerups.selective == false then
  678.                     if data[name].team == "azul" then
  679.                         tfm.exec.addShamanObject(objetos[math.random(#objetos)],x+80,y-60,0,(4+power*2)*-1,-8)
  680.                     elseif data[name].team == "vermelho" then
  681.                         tfm.exec.addShamanObject(objetos[math.random(#objetos)],x-80,y-60,0,4+power*2,-8)
  682.                     end
  683.                 end
  684.                 anvil_launched=true
  685.             else
  686.                 if powerups.invisible == false and powerups.selective == false then
  687.                     if data[name].team == "azul" then
  688.                         tfm.exec.addShamanObject(anvils[math.random(#anvils)],x,y-60,0,(4+power*2)*-1,-8)
  689.                     elseif data[name].team == "vermelho" then
  690.                         tfm.exec.addShamanObject(anvils[math.random(#anvils)],x,y-60,0,4+power*2,-8)
  691.                     end
  692.                     if powerups.double == true then
  693.                         if data[name].team == "azul" then
  694.                             tfm.exec.addShamanObject(anvils[math.random(#anvils)],x+40,y-60,0,(4+power*2)*-1,-8)
  695.                         elseif data[name].team == "vermelho" then
  696.                             tfm.exec.addShamanObject(anvils[math.random(#anvils)],x-40,y-60,0,4+power*2,-8)
  697.                         end
  698.                     end
  699.                     if powerups.triple == true then
  700.                         if data[name].team == "azul" then
  701.                             tfm.exec.addShamanObject(anvils[math.random(#anvils)],x+80,y-60,0,(4+power*2)*-1,-8)
  702.                         elseif data[name].team == "vermelho" then
  703.                         tfm.exec.addShamanObject(anvils[math.random(#anvils)],x-80,y-60,0,4+power*2,-8)
  704.                         end
  705.                     end
  706.                 else
  707.                     if data[name].team == "azul" then
  708.                         tfm.exec.addShamanObject(1010,x,y-60,0,(4+power*2)*-1,-8)
  709.                     elseif data[name].team == "vermelho" then
  710.                         tfm.exec.addShamanObject(1010,x,y-60,0,4+power*2,-8)
  711.                     end
  712.                 end
  713.                 anvil_launched=true
  714.             end
  715.             end
  716.         end
  717.     end
  718.     if key >= 49 and key <= 57 then
  719.         power=key-48
  720.         ui.addPopup(0,0,""..text.intensity..": "..power.."",name,350,175,200,true)
  721.     end
  722.     if key == 48 then
  723.         power=10
  724.         ui.addPopup(0,0,""..text.intensity..": "..power.."",name,350,175,200,true)
  725.     end
  726.     if powerups.selective == false then
  727.     if key == 112 then
  728.         if tfm.get.room.playerList[name].score >= 5 and powerups.double == false and powerups.triple == false then
  729.             powerups.double=true
  730.             tfm.exec.setPlayerScore(name,-5,true)
  731.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.double.."")
  732.         end
  733.     end
  734.     if key == 113 then
  735.         if tfm.get.room.playerList[name].score >= 9 and powerups.double == false and powerups.triple == false then
  736.             powerups.double=true
  737.             powerups.triple=true
  738.             tfm.exec.setPlayerScore(name,-9,true)
  739.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.triple.."")
  740.         end
  741.     end
  742.     if key == 114 then
  743.         if tfm.get.room.playerList[name].score >= 7 and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
  744.             powerups.bomba=true
  745.             tfm.exec.setPlayerScore(name,-7,true)
  746.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.bomba1.."")
  747.             tfm.exec.chatMessage(text.bomba2,name)
  748.             anvil_launched=true
  749.             loop=12
  750.         end
  751.     end
  752.     if key == 115 then
  753.         if tfm.get.room.playerList[name].score >= 6 and powerups.objeto == false then
  754.             powerups.objeto=true
  755.             tfm.exec.setPlayerScore(name,-6,true)
  756.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.objeto1.."")
  757.             tfm.exec.chatMessage(text.objeto2,name)
  758.         end
  759.     end
  760.     if key == 116 then
  761.         if tfm.get.room.playerList[name].score >= 22 and powerups.explosion == false and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
  762.             powerups.explosion=true
  763.             tfm.exec.setPlayerScore(name,-22,true)
  764.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.exp1.."")
  765.             tfm.exec.chatMessage(text.exp2,name)
  766.             anvil_launched=true
  767.             loop=12
  768.         end
  769.     end
  770.     if key == 117 then
  771.         if tfm.get.room.playerList[name].score >= 18 and powerups.explosion == false and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
  772.             powerups.chuva=true
  773.             tfm.exec.setPlayerScore(name,-18,true)
  774.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.chuva1.."")
  775.             tfm.exec.chatMessage(text.chuva2,name)
  776.         end
  777.     end
  778.     if key == 118 then
  779.         if tfm.get.room.playerList[name].score >= 6 and powerups.fly == false then
  780.             powerups.fly=true
  781.             tfm.exec.setPlayerScore(name,-6,true)
  782.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.fly1.."")
  783.             tfm.exec.chatMessage(text.fly2,name)
  784.         end
  785.     end
  786.     if key == 119 then
  787.         if tfm.get.room.playerList[name].score >= 20 and data[name].immortal2 == false then
  788.             data[name].immortal=true
  789.             data[name].immortal2=true
  790.             tfm.exec.setNameColor(name, 0x00ff00)
  791.             tfm.exec.setPlayerScore(name,-20,true)
  792.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.inv1.."")
  793.             tfm.exec.chatMessage(text.inv2,name)
  794.         end
  795.     end
  796.     if key == 120 then
  797.         if tfm.get.room.playerList[name].score >= 25 and powerups.double == false and powerups.triple == false and powerups.objeto == false and powerups.invisible == false then
  798.             powerups.invisible=true
  799.             tfm.exec.setPlayerScore(name,-25,true)
  800.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.invi1.."")
  801.             tfm.exec.chatMessage(text.invi2,name)
  802.         end
  803.     end
  804.     if key == 121 then
  805.         if tfm.get.room.playerList[name].score >= 5 and powerups.double == false and powerups.triple == false and powerups.objeto == false and powerups.invisible == false then
  806.             powerups.selective=true
  807.             ui.addTextArea(701,"<font size='12'>Select your object:<br>F1 = Anvil (0pt)<br>F2 = Small Box (1pt)<br>F3 = Green Apple (2pt)<br>F4 = Triangle (3pt)<br>F5 = Large Box (4pt)<br>F6 = Large Board (5pt)<br>F7 = Follow-up Box (6pt)<br>F8 = Giant Board (7pt)",actual_player,320,72,160,160,0x424242,0x424242,0.88,true)
  808.             tfm.exec.setGameTime(15)
  809.             time_limit=15
  810.             tfm.exec.setPlayerScore(name,-5,true)
  811.             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.selec1.."")
  812.             tfm.exec.chatMessage(text.selec2,name)
  813.         end
  814.     end
  815.     else
  816.         if key >= 112 and key <= 119 then
  817.         if key == 112 then
  818.             object=10
  819.         elseif key == 113 then
  820.             object=1
  821.             tfm.exec.setPlayerScore(name,-1,true)
  822.         elseif key == 114 then
  823.             object=39
  824.             tfm.exec.setPlayerScore(name,-2,true)
  825.         elseif key == 115 then
  826.             object=68
  827.             tfm.exec.setPlayerScore(name,-3,true)
  828.         elseif key == 116 then
  829.             object=2
  830.             tfm.exec.setPlayerScore(name,-4,true)
  831.         elseif key == 117 then
  832.             object=4
  833.             tfm.exec.setPlayerScore(name,-5,true)
  834.         elseif key == 118 then
  835.             object=61
  836.             tfm.exec.setPlayerScore(name,-6,true)
  837.         elseif key == 119 then
  838.             object=67
  839.             tfm.exec.setPlayerScore(name,-7,true)
  840.         end
  841.         ui.removeTextArea(701,nil)
  842.         end
  843.     end
  844.     end
  845. end
  846. function eventMouse(name,x,y)
  847.     if powerups.explosion == true and actual_player == name then
  848.         tfm.exec.explosion(x,y,30,120,true)
  849.         tfm.exec.displayParticle(12,x,y,0,0,0,0,nil)
  850.         powerups.explosion=false
  851.     end
  852.     if powerups.fly == true and actual_player == name and anvil_launched == false then
  853.         if data[name].team == "vermelho" then
  854.             if x < 790 and x > 200 then
  855.                 tfm.exec.movePlayer(name,x,190,false,0,0,false)
  856.             end
  857.         end
  858.         if data[name].team == "azul" then
  859.             if x > 810 and x < 1400 then
  860.                 tfm.exec.movePlayer(name,x,190,false,0,0,false)
  861.             end
  862.         end
  863.     end
  864. end
  865. function eventNewGame()
  866.     ui.setMapName(text.bar)
  867.     sudden_death=false
  868.     time_limit=15
  869.     reset=false
  870.     count_azul=0
  871.     count_vermelho=0
  872.     tempo=0
  873.     power=5
  874.     count=0
  875.     kills=0
  876.     play_azul={}
  877.     play_vermelho={}
  878.     valendo=false
  879.     loop=8
  880.     resetPowers()
  881.     for name,player in pairs(tfm.get.room.playerList) do
  882.         data[name].kd=math.floor((data[name].kills/data[name].matchs)*100)
  883.         data[name].killed=-1
  884.         data[name].team=""
  885.         data[name].immortal=false
  886.         data[name].immortal2=false
  887.         data[name].imatchs=0
  888.         tfm.exec.setNameColor(name,0xd7d7e6)
  889.         for i=32,123 do
  890.             tfm.exec.bindKeyboard(name,i,true,true)
  891.         end
  892.     end
  893.     tfm.exec.setGameTime(32)
  894.     ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>",nil, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
  895.     ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>",nil, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
  896.     tfm.exec.chatMessage("The profile and ranking has been updated.")
  897. end
  898. function eventTextAreaCallback(id,name,callback)
  899.     if callback == "show_menu" then
  900.         ui.addTextArea(299,"<p align='center'><a href='event:hide_menu'><font size='18'>Menu",name,365,24,70,24,0x000001,0x000001,0.75,true)
  901.         ui.addTextArea(298,text.menu_bar,name,275,55,250,20,0x000001,0x000001,0.80,true)
  902.     end
  903. if callback == "hide_menu" then
  904.         ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,24,70,24,0x000001,0x000001,0.75,true)
  905.         ui.removeTextArea(298,name)
  906.     end
  907.     if callback == "ranking" then
  908.         eventChatCommand(name,"rank")
  909.     end
  910.     if callback == "powerups" then
  911.         loadPowerups(name)
  912.     end
  913.     if callback == "power1" then
  914.         tfm.exec.chatMessage(text.double2,name)
  915.     end
  916.     if callback == "help" then
  917.         tfm.exec.chatMessage(text.help,name)
  918.     end
  919.     if callback == "power2" then
  920.         tfm.exec.chatMessage(text.triple2,name)
  921.     end
  922.     if callback == "power3" then
  923.         tfm.exec.chatMessage(text.bomba2,name)
  924.     end
  925.     if callback == "power4" then
  926.         tfm.exec.chatMessage(text.objeto2,name)
  927.     end
  928.     if callback == "power5" then
  929.         tfm.exec.chatMessage(text.exp2,name)
  930.     end
  931.     if callback == "power6" then
  932.         tfm.exec.chatMessage(text.chuva2,name)
  933.     end
  934.     if callback == "power7" then
  935.         tfm.exec.chatMessage(text.fly2,name)
  936.     end
  937.     if callback == "power8" then
  938.         tfm.exec.chatMessage(text.inv2,name)
  939.     end
  940.     if callback == "power9" then
  941.         tfm.exec.chatMessage(text.invi2,name)
  942.     end
  943.     if callback == "power10" then
  944.         tfm.exec.chatMessage(text.selec2,name)
  945.     end
  946.     if callback == "profile" then
  947.         tfm.exec.chatMessage(text.profile,name)
  948.     end
  949.     if callback == "fechar" then
  950.         for id=8000,8010 do
  951.             ui.removeTextArea(id,name)
  952.         end
  953.     end
  954.     if callback == "close" then
  955.         for id=8000,8010 do
  956.             ui.removeTextArea(id,name)
  957.             ui.removeTextArea(6969+id,name)
  958.             ui.removeTextArea(7979+id,name)
  959.         end
  960.     end
  961.     if callback == "closep" then
  962.         for id=9000,9010 do
  963.             ui.removeTextArea(id,name)
  964.         end
  965.     end
  966.     if callback == "enter_vermelho" then
  967.         if data[name].killed == -1 and data[name].team == "" then
  968.             data[name].team="vermelho"
  969.             data[name].killed=0
  970.             tfm.exec.respawnPlayer(name)
  971.             tfm.exec.movePlayer(name,math.random(200,750),180,false,0,0,false)
  972.             count_vermelho=count_vermelho+1
  973.             ui.removeTextArea(41,name)
  974.             ui.removeTextArea(42,name)
  975.             ui.addTextArea(51,"<p align='center'><a href='event:sair_vermelho'>"..text.exit.."",name,300,180,200,20,0x505050,0x323232,1.0,true)
  976.         end
  977.     end
  978.     if callback == "enter_azul" then
  979.         if data[name].killed == -1 and data[name].team == "" then
  980.             data[name].team="azul"
  981.             data[name].killed=0
  982.             tfm.exec.respawnPlayer(name)
  983.             tfm.exec.movePlayer(name,math.random(850,1400),180,false,0,0,false)
  984.             count_azul=count_azul+1
  985.             ui.removeTextArea(41,name)
  986.             ui.removeTextArea(42,name)
  987.             ui.addTextArea(52,"<p align='center'><a href='event:sair_azul'>"..text.exit.."",name,300,180,200,20,0x505050,0x323232,1.0,true)
  988.         end
  989.     end
  990.     if callback == "sair_azul" then
  991.         data[name].team=""
  992.         data[name].killed=-1
  993.         tfm.exec.killPlayer(name)
  994.         count_azul=count_azul-1
  995.         ui.removeTextArea(52,name)
  996.         ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>", name, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
  997.         ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>", name, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
  998.     end
  999.     if callback == "sair_vermelho" then
  1000.         data[name].team=""
  1001.         data[name].killed=-1
  1002.         tfm.exec.killPlayer(name)
  1003.         count_vermelho=count_vermelho-1
  1004.         ui.removeTextArea(51,name)
  1005.         ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>", name, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
  1006.         ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>", name, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
  1007.     end
  1008. end
  1009. function winRed()
  1010.     for name,player in pairs(tfm.get.room.playerList) do
  1011.         if data[name].team == "vermelho" then
  1012.             data[name].wins=data[name].wins+1
  1013.             data[name].score=data[name].score+15
  1014.             tfm.exec.respawnPlayer(name)
  1015.             tfm.exec.movePlayer(name,math.random(125,775),240,false,0,0,false)
  1016.             tfm.exec.playEmote(name,0)
  1017.         end
  1018.     end
  1019. end
  1020. function winAzul()
  1021.     for name,player in pairs(tfm.get.room.playerList) do
  1022.         if data[name].team == "azul" then
  1023.             data[name].wins=data[name].wins+1
  1024.             data[name].score=data[name].score+15
  1025.             tfm.exec.respawnPlayer(name)
  1026.             tfm.exec.movePlayer(name,math.random(825,1475),240,false,0,0,false)
  1027.             tfm.exec.playEmote(name,0)
  1028.         end
  1029.     end
  1030. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement