Advertisement
JessiewindScripts

Modules juntos 1.4

Aug 20th, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 111.89 KB | None | 0 0
  1. --[[ Script contendo o module #anvilwar, com #mestre sendo seus submodos. Compilado às 13h01 (UTC) 24/08/2018. ]]--
  2.  
  3. local modulo = {
  4.     _NOME = "anvilwar",
  5.     _VERSION = "1.4",
  6.     _AUTHOR = "Jessiewind26#2546"
  7. }
  8.  
  9. system.disableChatCommandDisplay("pw")
  10.  
  11. active = ""
  12. admin = ""
  13.  
  14. local modo = {}
  15.  
  16. resetAll = function()
  17.     for i=0,10000 do
  18.         ui.removeTextArea(i,nil)
  19.     end
  20.     for i=1,50 do
  21.         ui.addPopup(i,0,"",nil,-9999,9999)
  22.     end
  23.     for i=901,910 do
  24.         ui.addPopup(i,0,"",nil,-9999,9999)
  25.     end
  26.     for i=1201,1210 do
  27.         ui.addPopup(i,0,"",nil,-9999,9999)
  28.     end
  29.     for _,f in next,{"AutoShaman","AutoScore","AutoNewGame","AutoTimeLeft","MinimalistMode","PhysicalConsumables","AfkDeath","MortCommand","DebugCommand"} do
  30.     tfm.exec["disable"..f](false)
  31.     end
  32. end
  33.  
  34. roomAdmin = function()
  35.     for name,player in pairs(tfm.get.room.playerList) do
  36.         if string.find(tfm.get.room.name,name) then
  37.             admin=name
  38.         else
  39.             admin="Jessiewind26#2546"
  40.         end
  41.     end
  42. end
  43.  
  44. initAnvilwar = function()
  45. tfm.exec.disableAutoNewGame(true)
  46. tfm.exec.disableAutoShaman(true)
  47. tfm.exec.disableAutoScore(true)
  48. tfm.exec.disableAfkDeath(true)
  49. tfm.exec.disableAutoTimeLeft(true)
  50. tfm.exec.disableDebugCommand(true)
  51. tfm.exec.disablePhysicalConsumables(true)
  52. powerups={double=false,chuva=false,count=0,choosed="",bomba=false,objeto=false,explosion=false,fly=false,triple=false,invisible=false,selective=false,r_azul=false,r_vermelho=false} -- powerups
  53. play_azul={} -- jogadores do time azul
  54. players_table={} -- variável que define os jogadores novos, não alterar
  55. 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} -- objetos que podem ser atirados
  56. caps={azul="",vermelho=""} -- capitães dos times azul e vermelho
  57. play_vermelho={} -- jogadores do time azul
  58. avs_list={"Azirdeathray#0000"} -- avaliadores de mapas do module
  59. mods_list={} -- moderadores do module
  60. managers_list={"Varusofeyzan#0000","Jhinsword350#0000","Nasus_assassin#1534"} -- gerenciadores do module
  61. admins_list={"Jessiewind26#2546","Jarvanfender#0000"} -- administradores e criadores do module
  62. scoreloop=0 -- não alterar
  63. sudden_death=false -- modo morte súbita, não pode ser alterado
  64. local temp_name="" -- não alterar
  65. local temp_name2="" -- não alterar
  66. local temp_name3="" -- não alterar
  67. local skips=0 -- funcionalidade do comando !skip
  68. actual_player="" -- jogador atual a atirar
  69. tempo=0 -- tempo da partida
  70. players=0 -- não alterar
  71. time_limit=10 -- não alterar
  72. team=1 -- não alterar
  73. kills=0 -- não alterar
  74. data={} -- dados dos jogadores, não mexer
  75. ratos=0 -- não alterar
  76. loop=8 -- não alterar
  77. power=5 -- potência do tiro
  78. valendo=false -- variável que define quando o jogo está valendo
  79. anvil_launched=false -- variável que passa a vez pro próximo jogador
  80. set=false -- comando de admin, não alterar
  81. object=10 -- variável de objeto usada no powerup F10
  82. set_name="" -- comando de admin, não alterar
  83. reset=false -- variável que reinicia o mapa quando acabar a partida
  84. count=0 -- não alterar
  85. count_azul=0 -- quantidade de jogadores do time azul
  86. count_vermelho=0 -- quantidade de jogadores do time vermelho
  87. for _,f in next,{"help","powerups","set","tc","p","rank","data_score","score","kill","tt","rv","cap","cmd","acmd","ban","unban","skip"} do
  88.     system.disableChatCommandDisplay(f)
  89. end
  90. anvils={10,1002,1003,1004,1005} -- as bigornas
  91. mapas={"@7467262","@7463118","@7436867","@7412348","@7467977","@7470456","@7480017","@7433435","@7483583","@7485139","@7485233","@7486518","@7486596","@7486946","@7487828","@7488212","@7487008","@7493478","@7494251","@7493568","@7375714","@7495501","@7495286","@7495744","@7497388","@7499355","@7501996"}
  92. lang = {}
  93. lang.br = {
  94.     win_vermelho = "<R><b>GG Time Vermelho!</b><br>A próxima partida será iniciada em 15 segundos.",
  95.     win_azul = "<BL><b>GG Time Azul!</b><br>A próxima partida será iniciada em 15 segundos.",
  96.     sudden_death = "<VP><b>Morte Súbita!</b><br>A equipe que conseguir eliminar qualquer um adversário será declarada a vencedora.",
  97.     empate_text = "<J><b>Houve um empate!</b><br>A próxima partida será iniciada em 15 segundos.",
  98.     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.",
  99.     turn = "<VP>É a vez de",
  100.     timeout = "<J>Tempo esgotado! O atirador será alterado.",
  101.     enter_vermelho = "Entrar no time vermelho",
  102.     enter_azul = "Entrar no time azul",
  103.     exit = "Sair do time",
  104.     double = "acionou o powerup Bigorna Dupla!",
  105.     double2 = "<br>Neste powerup, você atira 2 bigornas de uma vez.",
  106.     triple = "acionou o powerup Bigorna Tripla!",
  107.     triple2 = "<br>Neste powerup, você atira 3 bigornas de uma vez.",
  108.     bomba1 = "acionou o powerup Bomba Relógio!",
  109.     bomba2 = "<br>Neste powerup, uma explosão em um lugar aleatório do time adversário ocorrerá.",
  110.     objeto1 = "acionou o powerup Tiro Aleatório!",
  111.     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.",
  112.     exp1 = "acionou o powerup Olha a Explosão!",
  113.     exp2 = "<br>Neste powerup, você pode gerar uma explosão clicando em um local do time inimigo.<br>Você possui 5 segundos para explodir!",
  114.     chuva1 = "acionou o powerup Chuva de Objetos!",
  115.     chuva2 = "<br>Neste powerup, ao atirar uma bigorna, irão aparecer diversos objetos continuamente até a troca de jogador.",
  116.     fly1 = "acionou o powerup Modo Teleport!",
  117.     fly2 = "<br>Neste powerup, enquanto você não atira uma bigorna, você poderá se teleportar clicando com o mouse.",
  118.     inv1 = "acionou o powerup Modo Imortal!",
  119.     inv2 = "<br>Neste powerup, você ficará imortal durante 4 turnos do seu time. Esta habilidade só pode ser utilizada uma vez por partida.",
  120.     inv3 = "Sua habilidade Modo Imortal expirou.",
  121.     invi1 = "acionou o powerup Bigorna Invisível!",
  122.     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.",
  123.     selec1 = "acionou o powerup Objeto Seletivo!",
  124.     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.",
  125.     bar = "#anvilwar - Compilação RTM 6230.065",
  126.     intensity = "Intensidade",
  127.     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.",
  128.     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>Digite !cmd para ver todos os comandos do jogo.<br><br><b>Créditos:</b><br>Desenvolvimento: Jessiewind26#2546 e Jarvanfender#0000<br>Powerups: Jhinsword350#0000 e Vidaloka9999#0000<br>Tradução: Nasus_assassin#1534 (EN) e Alexsaky#7307 (AR)",
  129.     enter = "<br><J>Confiram os novos submodos da sala #anvilwar:<br><br><VP>./sala #anvilwar0mestre - <N>Mestre Mandou<br><VP>./sala #anvilwar0ocean - <N>Oceano de Pedra (feito por Ahrizrdbrand#0000<br><VP>./sala #anvilwar0longjump - <N>Salto em Distância (feito por Camilledrain#0000)",
  130.     teamkill1 = "Oh não! ",
  131.     teamKill2 = "matou um companheiro de equipe",
  132.     ajuda = "Ajuda",
  133.     credits = "Créditos",
  134.     mostrar = "Mostrar",
  135.     seconds = "<ROSE>Faltam 60 segundos!",
  136.     seconds30 = "<ROSE>Faltam 30 segundos!",
  137.     seconds10 = "<ROSE>Faltam 10 segundos!",
  138.     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",
  139.     powerups2 = "6pts<br>12pts<br>7pts<br>6pts<br>25pts<br>20pts<br>4pts<br>20pts<br>14pts<br>5pts",
  140.     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>",
  141.     powerups4 = "1<br>2<br>2<br>2<br>5<br>6<br>2<br>5<br>4<br>3",
  142.     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.",
  143.     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>  |  <a href='event:cap'>Capitão</a>  |  <a href='event:cmd'>Comandos</a>",
  144.     powerupslist = "Lista de Poderes",
  145.     profile = "Use o comando !p para ver o seu perfil. Use !p [nome] para ver o perfil de outra pessoa.",
  146.     starting = "<VP>A partida está prestes a começar. Preparem-se!",
  147.     suicide = "O seguinte jogador cometeu suicídio: ",
  148.     ban = " foi banido da sala #anvilwar por ",
  149.     unban = " teve seu banimento removido da sala.",
  150.     caps = " foi escolhido para ser o capitão da equipe. Para saber mais informações, utilize o comando !cap ou a opção Capitão no Menu do module.",
  151.     cap = "Este tipo de jogador (escolhido aleatoriamente) receberá 50% a mais de pontuação que os outros e poderá transferir seus pontos para outro jogador de sua equipe usando o comando !tt [nome].<br>Você também poderá utilizar o comando !rv [nome] para reviver UM membro morto de sua equipe.",
  152.     cap_text = "<br><VP>Você é o capitão da sua equipe.<br><br>Você irá receber 50% mais pontos por tempo vivo e poderá transferir pontos para outros jogadores usando o comando !tt [nome].<br>Você também poderá utilizar o comando !rv [nome] para reviver UM membro morto de sua equipe.",
  153.     score30 = "<R>Você precisa de 30 pontos para usar isto.",
  154.     advanced = "<VP>Você acaba de avançar para o nível ",
  155.     tag_text = "<J>Não se esqueça de colocar a #tag no final do nome desejado! Caso contrário, o comando não irá funcionar!",
  156.     revivetext = "<J>O seguinte jogador reviveu: ",
  157.     yturn = "É a vez de: ",
  158.     level_error = "<R>Você não possível nível suficiente para usar isto.",
  159.     funct = "Função não permitida. Você colocou a #tag no nome?",
  160.     cmds = "Comandos do Jogo",
  161.     commands = "• !help = Exibe as instruções de como jogar.<br>• !p [jogador] = Exibe o perfil do jogador escolhido. Digite !p sem argumentos para ver o seu perfil.<br>• !rank = Exibe o ranking temporário de quem está na sala.<br>• !tc [mensagem] = Fala apenas com os jogadores do seu time.<br>• !skip = Envia um voto para pular o mapa atual. Este comando só pode ser usado quando a partida ainda não tiver começado.<br><ROSE>* <N>!rv [jogador] = Revive um jogador morto de sua equipe.<br><ROSE>* <N>!tt [jogador] = Transfere seus pontos para outro jogador<br><br>Os comandos marcados com <ROSE>* <N>são de uso exclusivo do capitão da equipe. Para saber mais sobre isso, digite !cap.",
  162.     admin_commands = "<BL>• <N>!skip = Pula o mapa atual.<br><BL>• <N>!pw [texto] = Adiciona uma senha na sala.<br><BL>• <N>!set_map [mapa] = Executa o mapa especificado.<br><J>• <N>!kill [nome] = Mata o jogador especificado.<br><R>• <N>!limit [número] = Limita a quantidade de ratos na sala.<br><br>Você só pode usar os comandos correspondentes a cor do seu nome.<br><br>Por motivos de segurança e estabilidade, nem todos os comandos especiais foram adicionados aqui."
  163. }
  164. lang.en = {
  165.     win_vermelho = "<R><b>The RED team wins!</b><br>The next match will start in 15 seconds.",
  166.     win_azul = "<BL><b>The BLUE team wins!</b><br>The next match will start in 15 seconds.",
  167.     sudden_death = "<VP><b>SUDDEN DEATH!</b><br>The team that kill anyone of other team will won the match.",
  168.     empate_text = "<J><b>There was a draw!</b><br>The next match will start in 15 seconds.",
  169.     instructions = "Use the 1 to 9 keys to change the intensity of anvil and SPACEBAR to throw a anvil.",
  170.     turn = "<VP>It's turn of",
  171.     timeout = "<J>Time is over! The shooter will be changed.",
  172.     enter_vermelho = "Enter on RED team",
  173.     enter_azul = "Enter on BLUE team",
  174.     exit = "Leave this team",
  175.     double = "used the powerup Double Anvil!",
  176.     triple = "used the powerup Triple Anvil!",
  177.     bomba1 = "used the powerup Time Bomb!",
  178.     bomba2 = "<br>On this powerup, a explosion will occur on a random place of enemy area.",
  179.     objeto1 = "used the powerup Random Shoot!",
  180.     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.",
  181.     exp1 = "used the powerup Explosion!",
  182.     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.",
  183.     chuva1 = "used the powerup Anvil Rain!",
  184.     chuva2 = "<br>On this powerup, you will shoot several anvils",
  185.     fly1 = "used the powerup Teleport Mode!",
  186.     fly2 = "<br>On this powerup, you can teleport your mice using the mouse click.",
  187.     inv1 = "used the powerup Immortal Mode!",
  188.     inv2 = "<br>On this powerup, you be immortal during the next 4 turns. This powerup only can be used 1 time per game.",
  189.     inv3 = "Your immortality has ended.",
  190.     invi1 = "used the powerup Invisible Anvil!",
  191.     invi2 = "<br>On this powerup, you will shoot a invisible anvil. This ability can't be used with double and triple anvils.",
  192.     selec1 = "used the powerup Selective Object!",
  193.     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.",
  194.     bar = "#anvilwar - Compilation RTM 6230.065",
  195.     intensity = "Intensity",
  196.     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.",
  197.     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>Type !cmd to show all the game commands.<br><br><b>Credits:</b><br>Development: Jessiewind26#2546 and Jarvanfender#0000<br>Powerups: Jhinsword350#0000 and Vidaloka9999#0000<br>Translations: Nasus_assassin#1534 (EN) and Alexsaky#7307 (AR)",
  198.     enter = "<J>Welcome to #anvilwar room! Type !help for more information.",
  199.     teamkill1 = "Oh no! ",
  200.     teamKill2 = "has killed a player of her team",
  201.     ajuda = "Help",
  202.     credits = "Credits",
  203.     mostrar = "Show",
  204.     seconds = "<ROSE>60 seconds remaining!",
  205.     seconds30 = "<ROSE>30 seconds remaining!",
  206.     seconds10 = "<ROSE>10 seconds remaining!",
  207.     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",
  208.     powerups2 = "6pt<br>12pt<br>7pt<br>6pt<br>25pt<br>20pt<br>4pt<br>20pt<br>14pt<br>5pt",
  209.     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>",
  210.     powerups4 = "1<br>2<br>2<br>2<br>5<br>6<br>2<br>5<br>4<br>3",
  211.     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.",
  212.     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>  |  <a href='event:cap'>Capitain</a>  |  <a href='event:cmd'>Commands</a>",
  213.     powerupslist = "Powerups List",
  214.     profile = "Use the !p command to view your profile and use !p [username] to view the profile of another user.",
  215.     starting = "<VP>The match will start on a few seconds. Get ready!",
  216.     suicide = "The following player committed suicide: ",
  217.     ban = " was banned of room by ",
  218.     unban = " was unbanned of room.",
  219.     caps = " was choosed to be the team capitain. To see more info about this, type !cap command or use the Capitain section on menu of the module.",
  220.     cap = "On this compilation was included the functionality of a capitain player. This type of player (that is choosed randomly) will receive 50% more points and will get the ability of transfer your points to other players alive on the match using the !tt [name] command. You can use the !rv [name] command to revive ONE team player dead.",
  221.     cap_text = "<br><VP>You are the team capitain.<br><br>You will receive 50% more points than other team players and can transfer your points to other team players using the !tt [name] command. You can use the !rv [name] command to revive ONE team player dead.",
  222.     score30 = "<R>You need 30 points to use this.",
  223.     advanced = "<VP>You reached the level ",
  224.     tag_text = "<J>Don't forget to insert the #tag on the target nickname, else this command don't will work!",
  225.     revivetext = "<J>The following player has been revived: ",
  226.     yturn = "Actual player: ",
  227.     level_error = "<R>You don't have level to use this. To view your level use the !p command.",
  228.     funct = "Function not allowed",
  229.     cmds = "Game commands",
  230.     commands = "• !help = Show the game help.<br>• !p [player] = Show the profile of selected player. Type !p without arguments to show your profile.<br>• !rank = Show the temporary room ranking.<br>• !tc [message] = Chat with other members of your team.<br>• !skip = Send a vote to skip the actual map. This command cannot be used during the match.<br><ROSE>* <N>!rv [player] = Revive a dead player of your team.<br><ROSE>* <N>!tt [player] = Transfer your points to another team member.<br><br>The commands marked with <ROSE>* <N>are of exclusive use of the team capitains. To see more info about this, use the !cap command.",
  231.     admin_commands = "<BL>• <N>!skip = Skip the actual map.<br><BL>• <N>!pw [texto] = Add a password on the room. Type only !pw to remove the password.<br><BL>• <N>!set_map [mapa] = Run the specified map.<br><J>• <N>!kill [nome] = Kill the specified player.<br><R>• <N>!limit [número] = Set a limit of mices on this room.<br><br>You only can use the commands that match with your name color."
  232. }
  233. lang.ar = {
  234.     win_vermelho = "<R><b>لقد ربح الفريق الاحمر !</b><br> سيتم بدء الجولة بعد 15 ثنية .",
  235.     win_azul = "<BL><b> لقد ربح الفريق الازرق!</b><br> ستيم بدء الجولة بعد 15 ثنية.",
  236.     sudden_death = "<VP><b>SUDDEN DEATH!</b><br>The team that kill anyone of other team will won the match.",
  237.     empate_text = "<J><b>There was a draw!</b><br>The next match will start in 15 seconds.",
  238.     instructions = "Use the 1 to 9 keys to change the intensity of anvil and SPACEBAR to throw a anvil.",
  239.     turn = "<VP>It's turn of",
  240.     timeout = "<J>Time is over! The shooter will be changed.",
  241.     enter_vermelho = "الدخول الى الفريق الاحمر",
  242.     enter_azul = "الدخول الى الفريق الازرق",
  243.     exit = "الخروج من الفريق",
  244.     double = "used the powerup Double Anvil!",
  245.     triple = "used the powerup Triple Anvil!",
  246.     bomba1 = "used the powerup Time Bomb!",
  247.     bomba2 = "<ar>في هذا powerup ، سوف يحدث انفجار في مكان عشوائي لمنطقة العدو.",
  248.     objeto1 = "استخدم powerup عشوائية تبادل لاطلاق النار!",
  249.     objeto2 = "<ar>على هذا powerup ، سوف تقوم بتصوير كائن شامان عشوائي بدلا من السندان. إذا كنت قد استخدمت Powerup مزدوج السندان ، يمكنك تبادل اثنين من الأشياء بدلا من واحدة.",
  250.     exp1 = "used the powerup Explosion!",
  251.     exp2 = "<ar>على هذا powerup ،عندك 5 ثوان لتسبب انفجارك.",
  252.     chuva1 = "استخدم powerup Anvil المطر!",
  253.     chuva2 = "<ar> في هذا powerup ، سوف تقوم بتصوير عدة سندان",
  254.     fly1 = "استخدم powere وضع النقل الفضائي!",
  255.     fly2 = "<br>في هذا powerup ، يمكنك نقل الفئران الخاصة بك باستخدام النقر بالماوس.",
  256.     inv1 = "تستخدم powerup وضع الخالد!",
  257.     inv2 = "<br> على هذا powerup ، تكون خالدة خلال ال 4 المقبلة. يمكن استخدام هذه الطاقة فقط مرة واحدة لكل لعبة.",
  258.     inv3 = " خلودك انتهى.",
  259.     invi1 = "استخدم powerup سندان غير مرئية!",
  260.     invi2 = "<br>على هذا powerup ، سوف تقوم باطلاق سندان غير مرئية. هذه القدرة لا يمكن استخدامها مع سندان مضاعف وثلاثي.",
  261.     selec1 = "used the powerup Selective Object!",
  262.     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.",
  263.     bar = "#anvilwar - Compilation RTM 2",
  264.     intensity = "Intensity",
  265.     your_turn = "<J>حان دورك لاطلاق النار. اضغط على مفتاح المسافة لرمي سندان واستخدام مفاتيح 1 إلى 9 لتغيير شدة السندان. استخدم مفاتيح F1 إلى F10 لاستخدام بووروبس.",
  266.     help = "اضغط على مفتاح المسافة لرمي سندان واستخدام مفاتيح 1 إلى 9 لتغيير شدة السندان. استخدم مفاتيح F1 إلى F10 لاستخدام بووروبس (اكتب! بووروبس). الفريق الذي يزيل فريق العدو يربح اللعبة.<br><br> اضعط !cmd لأظهار اوامر العبة.<br><br><b>العبة صنعت من طرف:</b><br>Development: Jessiewind26#2546 and Jarvanfender#0000<br>Powerups: Jhinsword350#0000 and Vidaloka9999#0000<br>Translations: Nasus_assassin#1534 (EN) and Alexsaky#7307 (AR)",
  267.     enter = "<J>Welcome to #anvilwar room! Type !help for more information.",
  268.     teamkill1 = "أوه لا! ",
  269.     teamKill2 = "قتل لاعب من فريقها",
  270.     ajuda = "المساعدة",
  271.     credits = "Credits  ",
  272.     mostrar = "اظهار",
  273.     seconds = "<ROSE>60 ثواني متبقية",
  274.     seconds30 = "<ROSE>30 ثواني متبقية!",
  275.     seconds10 = "<ROSE>10 ثواني متبقية!",
  276.     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",
  277.     powerups2 = "6pt<br>12pt<br>7pt<br>6pt<br>25pt<br>20pt<br>4pt<br>20pt<br>14pt<br>5pt",
  278.     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>",
  279.     powerups4 = "1<br>2<br>2<br>2<br>5<br>6<br>2<br>5<br>4<br>3",
  280.     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.",
  281.     menu_bar = "<p align='center'><a href='event:help'>المساعدة</a>  |  <a href='event:powerups'>زادت الطاقة</a>  |  <a href='event:profile'>الملف الشخصي</a>  |  <a href='event:ranking'>تصنيف</a>  |  <a href='event:cap'>كابيتان</a>  |  <a href='event:cmd'>الاوامر</a>",
  282.     powerupslist = " قائمة زادت الطاقة",
  283.     profile = "Use the !p command to view your profile and use !p [username] to view the profile of another user.",
  284.     starting = "<VP>The match will start on a few seconds. Get ready!",
  285.     suicide = "The following player committed suicide: ",
  286.     ban = " was banned of room by ",
  287.     unban = " was unbanned of room.",
  288.     caps = " was choosed to be the team capitain. To see more info about this, type !cap command or use the Capitain section on menu of the module.",
  289.     cap = "على هذا التجميع أدرجت وظيفة لاعب capitain. هذا النوع من المشغل (الذي يتم اختياره عشوائيًا) سيحصل على 50٪ من النقاط الإضافية وسيحصل على القدرة على نقل النقاط الخاصة بك إلى لاعبين آخرين على قيد الحياة باستخدام الأمر! tt [name]. يمكنك استخدام الأمر! rv [name] لإحياء لاعب فريق واحد.",
  290.     cap_text = "<br><VP>You are the team capitain.<br><br>You will receive 50% more points than other team players and can transfer your points to other team players using the !tt [name] command. You can use the !rv [name] command to revive ONE team player dead.",
  291.     score30 = "<R>You need 30 points to use this.",
  292.     advanced = "<VP>You reached the level ",
  293.     tag_text = "<J>Don't forget to insert the #tag on the target nickname, else this command don't will work!",
  294.     revivetext = "<J>The following player has been revived: ",
  295.     yturn = "Actual player: ",
  296.     level_error = "<R>You don't have level to use this. To view your level use the !p command.",
  297.     funct = "Function not allowed",
  298.     cmds = " اوامر العبة",
  299.     commands = "• !help = Show the game help.<br>• !p [player] = Show the profile of selected player. Type !p without arguments to show your profile.<br>• !rank = Show the temporary room ranking.<br>• !tc [message] = Chat with other members of your team.<br><ROSE>* <N>!rv [player] = Revive a dead player of your team.<br><ROSE>* <N>!tt [player] = Transfer your points to another team member.<br><br>The commands marked with <ROSE>* <N>are of exclusive use of the team capitains. To see more info about this, use the !cap command."
  300. }
  301. if tfm.get.room.community == "br" then
  302.     text = lang.br
  303. elseif tfm.get.room.community == "ar" then
  304.     text = lang.ar
  305. else
  306.     text = lang.en
  307. end
  308. function changeMap()
  309.     tfm.exec.newGame(mapas[math.random(#mapas)])
  310. end
  311. function resetPowers()
  312.     ui.removeTextArea(701,nil)
  313.     powerups.double=false
  314.     powerups.objeto=false
  315.     powerups.count=2
  316.     kills=0
  317.     powerups.bomba=false
  318.     powerups.explosion=false
  319.     powerups.chuva=false
  320.     powerups.fly=false
  321.     anvil_launched=false
  322.     powerups.triple=false
  323.     powerups.invisible=false
  324.     powerups.selective=false
  325.     powerups.r_vermelho=false
  326.     powerups.r_azul=false
  327.     set=false
  328.     advanceLevel()
  329.     skips=0
  330. end
  331. changeMap()
  332. function split(t,s)
  333.     local a={}
  334.     for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
  335.         table.insert(a,i)
  336.     end
  337.     return a
  338. end
  339. function eventRanking(name)
  340.     local sc = {}
  341.     for id, name in pairs(players_table) do
  342.         sc[#sc+1] = {n=name,s=data[name].score,f=data[name].kills,d=data[name].kd,l=data[name].nivel}
  343.     end
  344.  
  345.     table.sort(sc,function(a,b) return a.s>b.s end)
  346.  
  347.     str1 = ''
  348.     str2 = ''
  349.     str3 = ''
  350.     str4 = ''
  351.     str5 = ''
  352.     for k,v in pairs(sc) do
  353.         if k < 11 then
  354.             if str ~= '' then
  355.                 str1=str1.."<br><N>"..k.."° | <VP>"..v.n..""
  356.                 str2=str2.."<br><b><N>"..v.s.."</b>"
  357.                 str3=str3.."<br><N>"..v.f..""
  358.                 str4=str4.."<br><N>"..v.d..""
  359.                 str5=str5.."<br><N>"..v.l..""
  360.             else
  361.                 str1="<J>"..k.."° | <VP>"..v.n..""
  362.                 str2="<J><b>"..v.s.."</b>"
  363.                 str3="<J>"..v.f..""
  364.                 str4="<J>"..v.d..""
  365.                 str5="<J>"..v.l..""
  366.             end
  367.         end
  368.     end
  369.     ui.addTextArea(8000,'<B><J><font size="13"><p align="center">Temporary Ranking',name,100,100,600,30,nil,0x2e424d,nil,true)
  370.     ui.addTextArea(8001,"<B><font size='13'><font face='Consolas'>#      Name                                 Score       Kills     Ratio%    Level",name,110,110,580,20,0x0e232b,0x0e232b,nil,true)
  371.     ui.addTextArea(8002,"<B><font size='16'><font face='Consolas'>"..str1,name,110,130,580,220,0x0e232b,0x0e232b,nil,true)
  372.     ui.addTextArea(8003,"<p align='right'><font size='16'><font face='Consolas'>"..str2,name,400,130,60,220,0x0e232b,0x0e232b,nil,true)
  373.     ui.addTextArea(8004,"<p align='right'><font size='16'><font face='Consolas'>"..str3,name,485,130,60,220,0x0e232b,0x0e232b,nil,true)
  374.     ui.addTextArea(8005,"<p align='right'><font size='16'><font face='Consolas'>"..str4,name,575,130,45,220,0x0e232b,0x0e232b,nil,true)
  375.     ui.addTextArea(8007,"<p align='right'><font size='16'><font face='Consolas'>"..str5,name,635,130,45,220,0x0e232b,0x0e232b,nil,true)
  376.     ui.addTextArea(8006,"<p align='center'><font size='16'><R><a href='event:close'>Close</a>",name,300,350,210,20,0x3c5063,0x3c5063,nil,true)
  377. end
  378. function loadPowerups(name)
  379.     ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.powerupslist.."",name,100,80,600,30,nil,0x2e424d,nil,true)
  380.     ui.addTextArea(9001,"<font size='14'><font face='Consolas'>Powerup Name                          Score     Funct.   Min Level",name,110,110,580,20,0x0e232b,0x0e232b,nil,true)
  381.     ui.addTextArea(9002,"<font size='14'><font face='Consolas'>"..text.powerups1.."",name,110,135,580,175,0x0e232b,0x0e232b,nil,true)
  382.     ui.addTextArea(9003,"<font size='14'><font face='Consolas'>"..text.powerups2.."",name,420,135,60,175,0x0e232b,0x0e232b,nil,true)
  383.     ui.addTextArea(9004,"<font size='14'><font face='Consolas'>"..text.powerups3.."",name,500,135,60,175,0x0e232b,0x0e232b,nil,true)
  384.     ui.addTextArea(9005,"<font size='14'><font face='Consolas'>"..text.powerups4.."",name,570,135,60,175,0x0e232b,0x0e232b,nil,true)
  385.     ui.addTextArea(9006,"<font size='14'><R><a href='event:closep'>Close</a>",name,300,320,190,20,0x3c5063,0x3c5063,nil,true)
  386. end
  387. function eventChatCommand(name,message)
  388.     local arg = split(message, " ")
  389.     if arg[1] == "p" then
  390.         if arg[2] then
  391.             nome = arg[2]:lower():gsub('%a', string.upper, 1)
  392.         else
  393.             nome = name
  394.         end
  395.  
  396.         if tfm.get.room.playerList[nome] then
  397.             ui.addTextArea(8003,'<B><J><font size="17"><p align="center">'..nome,name,245,95,315,30,nil,0x2e424d,nil,true)
  398.             ui.addTextArea(8004,"<font size='12'><b>Level: "..data[nome].nivel.."</b><br><br>Experience: "..data[nome].exp.."/"..data[nome].maxp.."<br><br><br>Score: "..data[nome].score.."<br>Matchs played: "..data[nome].matchs.."<br><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,125,290,200,0x0e232b,0x0e232b,nil,true)
  399.             ui.addTextArea(8006,"",name,260,178,((data[nome].exp/data[nome].maxp)*270)+3,6,0xffffff,0x000001,nil,true)
  400.             ui.addTextArea(8005,"<R><p align='center'><B><a href='event:fechar'>Close</a>",name,255,320,290,20,0x3c5063,0x3c5063,nil,true)
  401.         else
  402.             tfm.exec.chatMessage("<R>"..nome.." isn't found in this room.</R>",name)
  403.         end
  404.     end
  405.  
  406.     if message == "rank" then
  407.         eventRanking(name)
  408.     end
  409.     if message == "r2" then
  410.         if data[name].level >= 5 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  411.             avs_list={}
  412.             tfm.exec.chatMessage("The map avaliators list has been deleted.")
  413.             for name,player in pairs(tfm.get.room.playerList) do
  414.                 if data[name].level == 2 then
  415.                     data[name].level=0
  416.                 end
  417.             end
  418.         end
  419.     end
  420.     if message == "r3" then
  421.         if data[name].level >= 5 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  422.             mods_list={}
  423.             tfm.exec.chatMessage("The moderators list has been deleted.")
  424.             for name,player in pairs(tfm.get.room.playerList) do
  425.                 if data[name].level == 3 then
  426.                     data[name].level=0
  427.                 end
  428.             end
  429.         end
  430.     end
  431.     if message == "r4" then
  432.         if data[name].level >= 5 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  433.             managers_list={}
  434.             tfm.exec.chatMessage("The managers list has been deleted.")
  435.             for name,player in pairs(tfm.get.room.playerList) do
  436.                 if data[name].level == 4 then
  437.                     data[name].level=0
  438.                 end
  439.             end
  440.         end
  441.     end
  442.     if(message:sub(0,4) == "kill") then
  443.         if data[name].level >= 3 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == admin then
  444.             tfm.exec.killPlayer(message:sub(6))
  445.         end
  446.     end
  447.     if(message:sub(0,7) == "ranking") then
  448.         if data[name].level >= 5 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  449.             temp_name=message:sub(9)
  450.             ui.addPopup(1207,2,"Ranking:",name,350,225,200,true)
  451.             tfm.exec.chatMessage(text.tag_text,name)
  452.         end
  453.     end
  454.     if(message:sub(0,7) == "set_map") then
  455.         if data[name].level >= 2 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == admin then
  456.             tfm.exec.newGame(message:sub(9))
  457.         end
  458.     end
  459.     if(message:sub(0,5) == "limit") then
  460.         if data[name].level >= 4 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == admin then
  461.             local limite=tonumber(message:sub(7))
  462.             tfm.exec.chatMessage("Room mice limit: "..limite.."")
  463.             tfm.exec.setRoomMaxPlayers(limite)
  464.         end
  465.     end
  466.     if(message:sub(0,3) == "ban") then
  467.         if data[name].level >= 3 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  468.             if data[message:sub(5)] then
  469.                 tfm.exec.killPlayer(message:sub(5))
  470.                 data[message:sub(5)].level=-1
  471.                 tfm.exec.chatMessage(""..message:sub(5)..""..text.ban..""..name..".")
  472.             else
  473.                 tfm.exec.chatMessage(text.funct,name)
  474.             end
  475.         end
  476.     end
  477.     if(message:sub(0,5) == "unban") then
  478.         if data[name].level >= 3 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  479.             if data[message:sub(7)] then
  480.                 data[message:sub(7)].level=0
  481.                 tfm.exec.chatMessage(""..message:sub(7)..""..text.unban.."")
  482.             else
  483.                 tfm.exec.chatMessage(text.funct,name)
  484.             end
  485.         end
  486.     end
  487.     if(message:sub(0,2) == "tc") then
  488.         local typer=name
  489.         if data[typer].team == "azul" then
  490.             for name,player in pairs(tfm.get.room.playerList) do
  491.                 if data[name].team == "azul" then
  492.                     tfm.exec.chatMessage("<font color='#0080ff'>• ["..typer.."] "..message:sub(4).."",name)
  493.                 end
  494.             end
  495.         elseif data[typer].team == "vermelho" then
  496.             for name,player in pairs(tfm.get.room.playerList) do
  497.                 if data[name].team == "vermelho" then
  498.                     tfm.exec.chatMessage("<font color='#ff8000'>• ["..typer.."] "..message:sub(4).."",name)
  499.                 end
  500.             end
  501.         end
  502.     end
  503.     if message == "reset" then
  504.         if data[name].level >= 2 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == admin then
  505.             changeMap()
  506.         end
  507.     end
  508.     if message == "skip" then
  509.         if ratos >= 10 then
  510.             local rato=ratos/2
  511.             if data[name].skip == 0 and valendo == false then
  512.                 skips=skips+1
  513.                 tfm.exec.chatMessage("Your skip vote has been added. ("..skips.."/"..rato..") ["..name.."]",name)
  514.                 tfm.exec.chatMessage("Your skip vote has been added. ("..skips.."/"..rato..") ["..name.."]","Jessiewind26#2546")
  515.                 data[name].skip=1
  516.                 if skips >= rato then
  517.                     changeMap()
  518.                 end
  519.             end
  520.         else
  521.             tfm.exec.chatMessage(text.funct,name)
  522.         end
  523.     end
  524.     if(message:sub(0,2) == "pw") then
  525.         if data[name].level >= 2 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == admin then
  526.             if message:sub(4) == "" then
  527.                 tfm.exec.setRoomPassword("")
  528.                 tfm.exec.chatMessage("Password cleared.",name)
  529.             else
  530.                 tfm.exec.setRoomPassword(message:sub(4))
  531.                 tfm.exec.chatMessage("Password: "..message:sub(4).."",name)
  532.             end
  533.         end
  534.     end
  535.     if(message:sub(0,3) == "set") then
  536.         if data[name].level >= 4 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  537.             if data[message:sub(5)] then
  538.                 set_name=message:sub(5)
  539.                 set=true
  540.             else
  541.                 tfm.exec.chatMessage(text.funct,name)
  542.             end
  543.         end
  544.     end
  545.     if(message:sub(0,2) == "tt") then
  546.         if name == caps.azul or name == caps.vermelho and valendo == true and reset == false then
  547.             temp_name2=message:sub(4)
  548.             if data[temp_name2] then
  549.                 ui.addPopup(1201,2,"1 = 5pts<br>2 = 10pts<br>3 = 15pts<br>4 = 20pts",name,350,225,200,true)
  550.                 tfm.exec.chatMessage(text.tag_text,name)
  551.             else
  552.                 tfm.exec.chatMessage(text.funct,name)
  553.             end
  554.         end
  555.     end
  556.     if(message:sub(0,2) == "rv") then
  557.         if name == caps.azul or name == caps.vermelho and valendo == true and reset == false then
  558.             temp_name3=message:sub(4)
  559.             if data[temp_name3] then
  560.                 ui.addPopup(1204,1,"Revive "..temp_name3.."?",name,350,225,200,true)
  561.                 tfm.exec.chatMessage(text.tag_text,name)
  562.             else
  563.                 tfm.exec.chatMessage(text.funct,name)
  564.             end
  565.         end
  566.     end
  567.     if(message:sub(0,5) == "score") then
  568.         if data[name].level >= 3 or name == "Jessiewind26#2546" or name == "Jarvanfender#0000" then
  569.             temp_name=message:sub(7)
  570.             ui.addPopup(906,2,"Score",name,350,175,200,true)
  571.         end
  572.     end
  573.     if message == "help" then
  574.         ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.ajuda.."",name,100,90,600,30,nil,0x2e424d,nil,true)
  575.         ui.addTextArea(9005,"<font size='13'><font face='Consolas'>"..text.help.."",name,150,125,500,170,0x0e232b,0x0e232b,nil,true)
  576.         ui.addTextArea(9006,"<font size='13'><R><a href='event:closep'>Close</a>",name,300,304,190,20,0x3c5063,0x3c5063,nil,true)
  577.     end
  578.     if message == "cmd" then
  579.         ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.cmds.."",name,100,90,600,30,nil,0x2e424d,nil,true)
  580.         ui.addTextArea(9005,"<font size='13'><font face='Consolas'>"..text.commands.."",name,150,125,500,200,0x0e232b,0x0e232b,nil,true)
  581.         ui.addTextArea(9006,"<font size='13'><R><a href='event:closep'>Close</a>",name,300,334,190,20,0x3c5063,0x3c5063,nil,true)
  582.     end
  583.     if message == "acmd" then
  584.         ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.cmds.."",name,100,90,600,30,nil,0x2e424d,nil,true)
  585.         ui.addTextArea(9005,"<font size='13'><font face='Consolas'>"..text.admin_commands.."",name,150,125,500,190,0x0e232b,0x0e232b,nil,true)
  586.         ui.addTextArea(9006,"<font size='13'><R><a href='event:closep'>Close</a>",name,300,324,190,20,0x3c5063,0x3c5063,nil,true)
  587.     end
  588.     if message == "cap" then
  589.         ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.cmds.."",name,100,110,600,30,nil,0x2e424d,nil,true)
  590.         ui.addTextArea(9005,"<font size='13'><font face='Consolas'>"..text.cap.."",name,150,145,500,100,0x0e232b,0x0e232b,nil,true)
  591.         ui.addTextArea(9006,"<font size='13'><R><a href='event:closep'>Close</a>",name,300,254,160,20,0x3c5063,0x3c5063,nil,true)
  592.     end
  593.     if message == "powerups" then
  594.         loadPowerups(name)
  595.     end
  596. end
  597. function eventPopupAnswer(id,name,message)
  598.     if id == 901 then
  599.         data[temp_name].score=tonumber(message)
  600.         return name
  601.     elseif id == 902 then
  602.         data[temp_name].kills=tonumber(message)
  603.         return name
  604.     elseif id == 903 then
  605.         data[temp_name].wins=tonumber(message)
  606.         return name
  607.     elseif id == 904 then
  608.         data[temp_name].matchs=tonumber(message)
  609.         return name
  610.     elseif id == 905 then
  611.         data[temp_name].kd=tonumber(message)
  612.         return name
  613.     elseif id == 906 then
  614.         tfm.exec.setPlayerScore(temp_name,tonumber(message),true)
  615.         return name
  616.     elseif id == 1201 then
  617.         if data[temp_name2] then
  618.             if message == "1" then
  619.                 if tfm.get.room.playerList[name].score < 5 then
  620.                     tfm.exec.chatMessage(text.funct,name)
  621.                 else
  622.                     tfm.exec.setPlayerScore(temp_name2,5,true)
  623.                     tfm.exec.setPlayerScore(name,-5,true)
  624.                     return name
  625.                 end
  626.             elseif message == "2" then
  627.                 if tfm.get.room.playerList[name].score < 10 then
  628.                     tfm.exec.chatMessage(text.funct,name)
  629.                 else
  630.                     tfm.exec.setPlayerScore(temp_name2,10,true)
  631.                     tfm.exec.setPlayerScore(name,-10,true)
  632.                     return name
  633.                 end
  634.             elseif message == "3" then
  635.                 if tfm.get.room.playerList[name].score < 15 then
  636.                     tfm.exec.chatMessage(text.funct,name)
  637.                 else
  638.                     tfm.exec.setPlayerScore(temp_name2,15,true)
  639.                     tfm.exec.setPlayerScore(name,-15,true)
  640.                     return name
  641.                 end
  642.             elseif message == "4" then
  643.                 if tfm.get.room.playerList[name].score < 20 then
  644.                     tfm.exec.chatMessage(text.funct,name)
  645.                 else
  646.                     tfm.exec.setPlayerScore(temp_name2,20,true)
  647.                     tfm.exec.setPlayerScore(name,-20,true)
  648.                     return name
  649.                 end
  650.             else
  651.                 tfm.exec.chatMessage(text.funct,name)
  652.             end
  653.         else
  654.             tfm.exec.chatMessage(text.funct,name)
  655.         end
  656.     elseif id == 1204 then
  657.         if message == "yes" then
  658.             if data[temp_name3] then
  659.                 if tfm.get.room.playerList[name].score >= 30 then
  660.                     tfm.exec.respawnPlayer(temp_name3)
  661.                     if data[temp_name3].team == "azul" and powerups.r_azul == false then
  662.                         powerups.r_azul=true
  663.                         tfm.exec.movePlayer(temp_name3,math.random(850,1200),160,false,0,0,false)
  664.                         data[temp_name3].killed=0
  665.                     elseif data[temp_name3].team == "vermelho" and powerups.r_vermelho == false then
  666.                         powerups.r_vermelho=true
  667.                         tfm.exec.movePlayer(temp_name3,math.random(400,750),160,false,0,0,false)
  668.                         data[temp_name3].killed=0
  669.                     end
  670.                     tfm.exec.setPlayerScore(name,-30,true)
  671.                     tfm.exec.chatMessage(""..text.revivetext..""..temp_name3.."")
  672.                 else
  673.                     tfm.exec.chatMessage(text.score30,name)
  674.                 end
  675.             else
  676.                 tfm.exec.chatMessage(text.funct,name)
  677.             end
  678.         end
  679.     elseif id == 1207 then
  680.         if data[temp_name] then
  681.             if tonumber(message) == 2 then
  682.                 table.insert(avs_list,temp_name)
  683.                 giveCargos(temp_name,2)
  684.                 tfm.exec.chatMessage("<J>"..temp_name.." has been turned Map User.")
  685.             elseif tonumber(message) == 3 then
  686.                 table.insert(mods_list,temp_name)
  687.                 giveCargos(temp_name,3)
  688.                 tfm.exec.chatMessage("<J>"..temp_name.." has been turned Moderator.")
  689.             elseif tonumber(message) == 4 then
  690.                 table.insert(managers_list,temp_name)
  691.                 giveCargos(temp_name,4)
  692.                 tfm.exec.chatMessage("<J>"..temp_name.." has been turned Manager.")
  693.             else
  694.                 tfm.exec.chatMessage(text.funct,name)
  695.             end
  696.         else
  697.             tfm.exec.chatMessage(text.funct,name)
  698.         end
  699.     end
  700. end
  701. function showTeams(name)
  702.     if valendo == false then
  703.         if name:sub(1,1) == "*" then
  704.             tfm.exec.killPlayer(name)
  705.             tfm.exec.chatMessage("<R>You must be connected to a Transformice account to play #anvilwar.",name)
  706.         elseif data[name].level <= -1 then
  707.             tfm.exec.killPlayer(name)
  708.             tfm.exec.chatMessage("<R>This account was banned of #anvilwar room.",name)
  709.         else
  710.             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)
  711.             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)
  712.         end
  713.     end
  714. end
  715. function eventLoop(passado,faltando)
  716.     if passado > 1200 and passado < 1700 then
  717.         tfm.exec.chatMessage("Playing map <J>"..tfm.get.room.currentMap.."<BL> created by <J>"..tfm.get.room.xmlMapInfo.author)
  718.     end
  719.     local minutos=math.floor(tempo/60)
  720.     local segundos=math.floor((minutos*60)-tempo) * -1
  721.     if valendo == true and tempo < 60 and tempo > 59 and sudden_death == false then
  722.         tfm.exec.chatMessage(text.seconds,nil)
  723.     end
  724.     if valendo == true and tempo < 30 and tempo > 29 and sudden_death == false then
  725.         tfm.exec.chatMessage(text.seconds30,nil)
  726.     end
  727.     if valendo == true and tempo < 10 and tempo > 9 then
  728.         tfm.exec.chatMessage(text.seconds10,nil)
  729.     end
  730.     if valendo == true and reset == false then
  731.         tempo=tempo-0.5
  732.         if tempo < 0 then
  733.             tempo=0
  734.         end
  735.         scoreloop=scoreloop+1
  736.         if scoreloop >= 40 then
  737.             for name,player in pairs(tfm.get.room.playerList) do
  738.                 if data[name].killed == 0 then
  739.                     tfm.exec.setPlayerScore(name,2,true)
  740.                     data[name].score=data[name].score+1
  741.                     data[name].exp=data[name].exp+1
  742.                     if name == caps.vermelho or name == caps.azul then
  743.                         tfm.exec.setPlayerScore(name,2,true)
  744.                         data[name].score=data[name].score+1
  745.                     end
  746.                 end
  747.             end
  748.             scoreloop=0
  749.         end
  750.     end
  751.     if anvil_launched == false and valendo == true then
  752.         ui.addTextArea(501,"<font size='40'><p align='center'>"..math.floor(faltando/1000).."",actual_player,360,310,80,55,0x000001,0x000001,1.0,true)
  753.     else
  754.         ui.removeTextArea(501,actual_player)
  755.     end
  756.     if valendo == true and reset == false and tempo <= 0 and sudden_death == true then
  757.         if count_vermelho > count_azul then
  758.             tfm.exec.chatMessage(text.win_vermelho)
  759.         elseif count_vermelho < count_azul then
  760.             tfm.exec.chatMessage(text.win_azul)
  761.         else
  762.             tfm.exec.chatMessage(text.empate_text)
  763.         end
  764.         count_azul=0
  765.         count_vermelho=0
  766.         valendo=false
  767.         reset=true
  768.         tfm.exec.setGameTime(15)
  769.     end
  770.     if reset == true then
  771.         if faltando < 1 then
  772.             changeMap()
  773.         end
  774.     end
  775.     if valendo == true and reset == false and anvil_launched == false then
  776.         time_limit=time_limit-0.5
  777.         if time_limit == 0 then
  778.             anvil_launched=true
  779.             time_limit=15
  780.             tfm.exec.chatMessage(text.timeout)
  781.         end
  782.     end
  783.     if valendo == false and reset == false and faltando < 1888 and count_azul > 0 and count_vermelho > 0 then
  784.         for i=11,297 do
  785.             ui.removeTextArea(i,nil)
  786.         end
  787.     end
  788.     if valendo == false and reset == false and faltando <= 1 then
  789.         if count_azul > 0 and count_vermelho > 0 then
  790.             if count == 0 then
  791.                 for name,player in pairs(tfm.get.room.playerList) do
  792.                     tfm.exec.chatMessage(text.starting,name)
  793.                     if data[name].team == "azul" then
  794.                         data[name].matchs=data[name].matchs+1
  795.                         tfm.exec.respawnPlayer(name)
  796.                         tfm.exec.movePlayer(name,1000,160,false,0,0,false)
  797.                         table.insert(play_azul,name)
  798.                         tfm.exec.setPlayerScore(name,0,false)
  799.                     elseif data[name].team == "vermelho" then
  800.                         data[name].matchs=data[name].matchs+1
  801.                         tfm.exec.respawnPlayer(name)
  802.                         tfm.exec.movePlayer(name,600,160,false,0,0,false)
  803.                         table.insert(play_vermelho,name)
  804.                         tfm.exec.setPlayerScore(name,0,false)
  805.                     else
  806.                         tfm.exec.movePlayer(name,800,-2000,false,0,0,false)
  807.                         tfm.exec.setPlayerScore(name,-1,false)
  808.                         kills=0
  809.                     end
  810.                 end
  811.             end
  812.             kills=0
  813.             count=count+0.5
  814.             if count >= 10 then
  815.                 caps.azul=play_azul[math.random(#play_azul)]
  816.                 caps.vermelho=play_vermelho[math.random(#play_vermelho)]
  817.                 for name,player in pairs(tfm.get.room.playerList) do
  818.                     if data[name].team == "azul" then
  819.                         tfm.exec.chatMessage(""..caps.azul..""..text.caps.."",name)
  820.                     elseif data[name].team == "vermelho" then
  821.                         tfm.exec.chatMessage(""..caps.vermelho..""..text.caps.."",name)
  822.                     end
  823.                     if name == caps.azul or name == caps.vermelho then
  824.                         tfm.exec.chatMessage(text.cap_text,name)
  825.                         tfm.exec.setNameColor(name,0x8000ff)
  826.                     end
  827.                 end
  828.                 valendo=true
  829.                 players=count_azul+count_vermelho
  830.                 tempo=120+(players*6)
  831.                 for i=11,297 do
  832.                     ui.removeTextArea(i,nil)
  833.                 end
  834.                 if team == 2 then
  835.                     team=1
  836.                     if set == false then
  837.                         actual_player=play_vermelho[math.random(#play_vermelho)]
  838.                     else
  839.                         actual_player=set_name
  840.                     end
  841.                 else
  842.                     team=2
  843.                     if set == false then
  844.                         actual_player=play_azul[math.random(#play_azul)]
  845.                     else
  846.                         actual_player=set_name
  847.                     end
  848.                 end
  849.                 loop=10
  850.                 anvil_launched=false
  851.                 tfm.exec.setGameTime(15)
  852.                 time_limit=15
  853.                 if valendo == true and reset == false then
  854.                     tfm.exec.chatMessage(text.your_turn,actual_player)
  855.                 end
  856.             end
  857.         else
  858.             tfm.exec.setGameTime(15)
  859.         end
  860.     end
  861.     if valendo == true and anvil_launched == true then
  862.         loop=loop-1
  863.         if loop == 0 then
  864.             if kills >= 3 then
  865.                 data[actual_player].mks=data[actual_player].mks+1
  866.             end
  867.             if not tfm.get.room.community == "br" then
  868.                 if kills == 2 then
  869.                     tfm.exec.chatMessage("<ROSE>Double Kill of "..actual_player.."!")
  870.                 elseif kills >= 3 then
  871.                     tfm.exec.chatMessage("<ROSE>Multi Kill: "..kills.." kills of "..actual_player.."!")
  872.                 end
  873.             else
  874.                 if kills == 2 then
  875.                     tfm.exec.chatMessage("<ROSE>Double Kill of "..actual_player.."!")
  876.                 elseif kills >= 3 then
  877.                     tfm.exec.chatMessage("<ROSE>Multi Kill: "..kills.." kills of "..actual_player.."!")
  878.                 end
  879.             end
  880.             kills=0
  881.             play_azul={}
  882.             play_vermelho={}
  883.             count_azul=0
  884.             count_vermelho=0
  885.             for name,player in pairs(tfm.get.room.playerList) do
  886.                 if data[name].team == "azul" then
  887.                     if data[name].killed == 0 then
  888.                         table.insert(play_azul,name)
  889.                         count_azul=count_azul+1
  890.                     end
  891.                 end
  892.                 if data[name].team == "vermelho" then
  893.                     if data[name].killed == 0 then
  894.                         table.insert(play_vermelho,name)
  895.                         count_vermelho=count_vermelho+1
  896.                     end
  897.                 end
  898.                 if data[name].immortal == true then
  899.                     data[name].imatchs=data[name].imatchs+1
  900.                     if data[name].imatchs >= 9 then
  901.                         data[name].immortal=false
  902.                         tfm.exec.chatMessage(text.inv3,name)
  903.                         tfm.exec.setNameColor(name,0xd7d7e6)
  904.                     end
  905.                 end
  906.             end
  907.             if team == 2 then
  908.                 team=1
  909.                 if set == false then
  910.                     actual_player=play_vermelho[math.random(#play_vermelho)]
  911.                 else
  912.                     actual_player=set_name
  913.                 end
  914.             else
  915.                 team=2
  916.                 if set == false then
  917.                     actual_player=play_azul[math.random(#play_azul)]
  918.                 else
  919.                     actual_player=set_name
  920.                 end
  921.             end
  922.             loop=8
  923.             resetPowers()
  924.             if valendo == true and reset == false then
  925.                 if count_azul == 0 then
  926.                     winRed()
  927.                     tfm.exec.chatMessage(text.win_vermelho)
  928.                     valendo=false
  929.                     reset=true
  930.                     tfm.exec.setGameTime(15)
  931.                 elseif count_vermelho == 0 then
  932.                     winAzul()
  933.                     tfm.exec.chatMessage(text.win_azul)
  934.                     valendo=false
  935.                     reset=true
  936.                     tfm.exec.setGameTime(15)
  937.                 elseif count_azul == 0 and count_vermelho == 0 then
  938.                     tfm.exec.chatMessage(text.empate_text)
  939.                     valendo=false
  940.                     reset=true
  941.                     tfm.exec.setGameTime(15)
  942.                 end
  943.             end
  944.             tfm.exec.setGameTime(15)
  945.             time_limit=15
  946.             if valendo == true and reset == false then
  947.                 tfm.exec.chatMessage(text.your_turn,actual_player)
  948.             end
  949.         end
  950.     end
  951.     if valendo == true and reset == false and tempo <= 0 and sudden_death == false and anvil_launched == false then
  952.         if count_vermelho > count_azul then
  953.             tfm.exec.chatMessage(text.win_vermelho)
  954.             winRed()
  955.             valendo=false
  956.             reset=true
  957.             tfm.exec.setGameTime(15)
  958.             count_azul=0
  959.             count_vermelho=0
  960.         elseif count_vermelho < count_azul then
  961.             tfm.exec.chatMessage(text.win_azul)
  962.             winAzul()
  963.             valendo=false
  964.             reset=true
  965.             tfm.exec.setGameTime(15)
  966.             count_azul=0
  967.             count_vermelho=0
  968.         elseif count_vermelho == count_azul and count_vermelho >= 2 and count_azul >= 2 then
  969.             tempo=60
  970.             tfm.exec.setGameTime(90)
  971.             tfm.exec.chatMessage(text.sudden_death)
  972.             sudden_death=true
  973.         elseif count_vermelho == count_azul and count_vermelho <= 1 and count_azul <= 1 then
  974.             valendo=false
  975.             reset=true
  976.             tfm.exec.setGameTime(15)
  977.             count_azul=0
  978.             count_vermelho=0
  979.             tfm.exec.chatMessage(text.empate_text)
  980.         end
  981.     end
  982.     if powerups.bomba == true then
  983.         powerups.count=powerups.count+1
  984.         if powerups.count == 3 then
  985.             local x_position=0
  986.             if data[actual_player].team == "azul" then
  987.                 x_position=math.random(100,750)
  988.                 tfm.exec.explosion(x_position,200,30,120,true)
  989.                 tfm.exec.displayParticle(12,x_position,200,0,0,0,0,nil)
  990.             elseif data[actual_player].team == "vermelho" then
  991.                 x_position=math.random(850,1500)
  992.                 tfm.exec.explosion(x_position,200,30,120,true)
  993.                 tfm.exec.displayParticle(12,x_position,200,0,0,0,0,nil)
  994.             end
  995.             powerups.count=2
  996.             powerups.bomba=false
  997.         end
  998.     end
  999.     if powerups.chuva == true and anvil_launched == true then
  1000.         if data[actual_player].team == "azul" then
  1001.             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)
  1002.         elseif data[actual_player].team == "vermelho" then
  1003.             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)
  1004.         end
  1005.     end
  1006.     if valendo == true and reset == false and faltando > 10000 then
  1007.         if data[actual_player].team == "azul" then
  1008.             ui.addTextArea(2204,"<p align='center'><font size='14'>"..text.yturn.."<b><font color='#0197f3'>"..actual_player.."",nil,200,82,400,27,0x000001,0x000001,1.0,true)
  1009.         else
  1010.             ui.addTextArea(2204,"<p align='center'><font size='14'>"..text.yturn.."<b><font color='#f32202'>"..actual_player.."",nil,200,82,400,27,0x000001,0x000001,1.0,true)
  1011.         end
  1012.     else
  1013.         ui.removeTextArea(2204,nil)
  1014.     end
  1015.     if valendo == true and reset == false then
  1016.         ui.addTextArea(2201,"<p align='center'><font color='#000001'><font size='35'><font face='Trebuchet MS'>"..count_vermelho.."",nil,200,24,64,48,0x990000,0xff0000,1.0,true)
  1017.         ui.addTextArea(2202,"<p align='center'><font color='#aaaaaa'><font size='35'><font face='Trebuchet MS'>"..count_azul.."",nil,536,24,64,48,0x000099,0x0000ff,1.0,true)
  1018.         if sudden_death == false then
  1019.             if segundos < 10 and tempo > 29.5 then
  1020.                 ui.addTextArea(14,"<p align='center'><font size='24'><font face='Segoe UI Symbol'>⏱<font face='Arial'> <b>"..minutos..":0"..segundos.."</b>",nil,350,24,100,34,0x000001,0x000001,1.0,true)
  1021.             elseif segundos >= 10 and tempo > 29.5 then
  1022.                 ui.addTextArea(14,"<p align='center'><font size='24'><font face='Segoe UI Symbol'>⏱<font face='Arial'> <b>"..minutos..":"..segundos.."</b>",nil,350,24,100,34,0x000001,0x000001,1.0,true)
  1023.             elseif segundos < 10 and tempo <= 29.5 then
  1024.                 ui.addTextArea(14,"<p align='center'><font size='24'><font face='Segoe UI Symbol'>⏱<font face='Arial'> <font color='#ff0000'><b>"..minutos..":0"..segundos.."</b>",nil,350,24,100,34,0x000001,0x000001,1.0,true)
  1025.             elseif segundos >= 10 and tempo <= 29.5 then
  1026.                 ui.addTextArea(14,"<p align='center'><font size='24'><font face='Segoe UI Symbol'>⏱<font face='Arial'> <font color='#ff0000'><b>"..minutos..":"..segundos.."</b>",nil,350,24,100,34,0x000001,0x000001,1.0,true)
  1027.             end
  1028.         else
  1029.             if segundos < 10 then
  1030.                 ui.addTextArea(14,"<p align='center'><font size='24'><font face='Segoe UI Symbol'>⏱<font face='Arial'> <b>"..minutos..":0"..segundos.."</b>",nil,350,24,100,34,0x400000,0x300000,1.0,true)
  1031.             elseif segundos >= 10 then
  1032.                 ui.addTextArea(14,"<p align='center'><font size='24'><font face='Segoe UI Symbol'>⏱<font face='Arial'> <b>"..minutos..":"..segundos.."</b>",nil,350,24,100,34,0x400000,0x300000,1.0,true)
  1033.             end
  1034.         end
  1035.     else
  1036.         ui.removeTextArea(14,nil)
  1037.         ui.removeTextArea(2201,nil)
  1038.         ui.removeTextArea(2202,nil)
  1039.     end
  1040. end
  1041. function eventPlayerDied(name)
  1042.     if count < 10 then
  1043.         if data[name].team == "azul" then
  1044.             tfm.exec.respawnPlayer(name)
  1045.             tfm.exec.movePlayer(name,900,180,false,0,0,false)
  1046.         elseif data[name].team == "vermelho" then
  1047.             tfm.exec.respawnPlayer(name)
  1048.             tfm.exec.movePlayer(name,700,180,false,0,0,false)
  1049.         end
  1050.     end
  1051.     if data[name].immortal == false then
  1052.         if valendo == true and reset == false then
  1053.             tfm.exec.setPlayerScore(name,-1,false)
  1054.             tfm.exec.setPlayerScore(actual_player,2,true)
  1055.             if actual_player == caps.vermelho or name == actual_player then
  1056.                 tfm.exec.setPlayerScore(actual_player,1,true)
  1057.                 data[actual_player].score=data[actual_player].score+1
  1058.                 data[actual_player].exp=data[actual_player].exp+1
  1059.             end
  1060.             data[actual_player].kills=data[actual_player].kills+1
  1061.             data[actual_player].score=data[actual_player].score+5
  1062.             loop=loop+1
  1063.             data[name].killed=1
  1064.             kills=kills+1
  1065.             data[actual_player].exp=data[actual_player].exp+3*kills
  1066.             if kills > data[actual_player].max then
  1067.                 data[actual_player].max=kills
  1068.                 data[actual_player].exp=data[actual_player].exp+6
  1069.             end
  1070.             if data[name].team == data[actual_player].team and anvil_launched == true then
  1071.                 tfm.exec.chatMessage("<J>"..text.teamkill1..""..actual_player.." "..text.teamKill2..": <b>"..name.."</b>.")
  1072.                 tfm.exec.setPlayerScore(actual_player,-4,true)
  1073.                 kills=kills-1
  1074.                 data[actual_player].kills=data[actual_player].kills-1
  1075.                 data[actual_player].score=data[actual_player].score-15
  1076.                 data[actual_player].exp=data[actual_player].exp-8
  1077.             end
  1078.         end
  1079.         if name == actual_player and valendo == true and reset == false then
  1080.             tfm.exec.chatMessage(""..text.suicide..""..actual_player.."")
  1081.         end
  1082.     else
  1083.         tfm.exec.respawnPlayer(name)
  1084.         tfm.exec.setNameColor(name,0x00ff00)
  1085.         if data[name].team == "azul" then
  1086.             tfm.exec.movePlayer(name,1000,160,false,0,0,false)
  1087.         elseif data[name].team == "vermelho" then
  1088.             tfm.exec.movePlayer(name,600,160,false,0,0,false)
  1089.         end
  1090.     end
  1091.     if sudden_death == true then
  1092.         if data[name].team == "azul" and data[name].immortal == false then
  1093.             winRed()
  1094.             tfm.exec.chatMessage(text.win_vermelho)
  1095.             count_azul=0
  1096.         elseif data[name].team == "vermelho" and data[name].immortal == false then
  1097.             winAzul()
  1098.             tfm.exec.chatMessage(text.win_azul)
  1099.             count_vermelho=0
  1100.         end
  1101.         valendo=false
  1102.         reset=true
  1103.         tfm.exec.setGameTime(15)
  1104.         sudden_death=false
  1105.     end
  1106.     if actual_player == name then
  1107.         anvil_launched=true
  1108.         actual_palayer=""
  1109.     end
  1110. end
  1111. function eventPlayerLeft(name)
  1112.     ratos=ratos-1
  1113.     data[name].killed=-1
  1114.     data[name].team=""
  1115. end
  1116. function eventNewPlayer(name)
  1117.     ratos=ratos+1
  1118.     tfm.exec.chatMessage(text.enter,name)
  1119.     if not data[name] then
  1120.         table.insert(players_table,name)
  1121.         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,level=0,nivel=1,exp=0,maxp=50}
  1122.     end
  1123.     showTeams(name)
  1124.     for name,player in pairs(tfm.get.room.playerList) do
  1125.         ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,376,70,24,0x000001,0x000001,0.75,true)
  1126.         for i=32,123 do
  1127.             tfm.exec.bindKeyboard(name,i,true,true)
  1128.             system.bindMouse(name,true)
  1129.         end
  1130.     end
  1131.     if name:sub(1,1) == "*" then
  1132.         data[name].level=-1
  1133.     end
  1134. end
  1135. for name,player in pairs(tfm.get.room.playerList) do
  1136.     eventNewPlayer(name)
  1137.     tfm.exec.setPlayerScore(name,0,false)
  1138. end
  1139. function eventKeyboard(name,key,down,x,y)
  1140.     if anvil_launched == false then
  1141.         if actual_player == name then
  1142.             if key == 32 then
  1143.                 if valendo == true then
  1144.                     powerups.fly=false
  1145.                     set=false
  1146.                     set_name=""
  1147.                     ui.removeTextArea(4003,nil)
  1148.                     if powerups.selective == true then
  1149.                         if data[name].team == "azul" then
  1150.                             tfm.exec.addShamanObject(object,x,y-60,0,(4+power*2)*-1,-8)
  1151.                         elseif data[name].team == "vermelho" then
  1152.                             tfm.exec.addShamanObject(object,x,y-60,0,4+power*2,-8)
  1153.                         end
  1154.                     end
  1155.                     if powerups.objeto == true and powerups.selective == false then
  1156.                         if data[name].team == "azul" then
  1157.                             tfm.exec.addShamanObject(objetos[math.random(#objetos)],x,y-60,0,(4+power*2)*-1,-8)
  1158.                         elseif data[name].team == "vermelho" then
  1159.                             tfm.exec.addShamanObject(objetos[math.random(#objetos)],x,y-60,0,4+power*2,-8)
  1160.                         end
  1161.                         if powerups.double == true and powerups.selective == false then
  1162.                             if data[name].team == "azul" then
  1163.                                 tfm.exec.addShamanObject(objetos[math.random(#objetos)],x+40,y-60,0,(4+power*2)*-1,-8)
  1164.                             elseif data[name].team == "vermelho" then
  1165.                                 tfm.exec.addShamanObject(objetos[math.random(#objetos)],x-40,y-60,0,4+power*2,-8)
  1166.                             end
  1167.                         end
  1168.                         if powerups.triple == true and powerups.selective == false then
  1169.                             if data[name].team == "azul" then
  1170.                                 tfm.exec.addShamanObject(objetos[math.random(#objetos)],x+80,y-60,0,(4+power*2)*-1,-8)
  1171.                             elseif data[name].team == "vermelho" then
  1172.                                 tfm.exec.addShamanObject(objetos[math.random(#objetos)],x-80,y-60,0,4+power*2,-8)
  1173.                             end
  1174.                         end
  1175.                         anvil_launched=true
  1176.                     else
  1177.                         if powerups.invisible == false and powerups.selective == false then
  1178.                             if data[name].team == "azul" then
  1179.                                 tfm.exec.addShamanObject(anvils[math.random(#anvils)],x,y-60,0,(4+power*2)*-1,-8)
  1180.                             elseif data[name].team == "vermelho" then
  1181.                                 tfm.exec.addShamanObject(anvils[math.random(#anvils)],x,y-60,0,4+power*2,-8)
  1182.                             end
  1183.                             if powerups.double == true then
  1184.                                 if data[name].team == "azul" then
  1185.                                     tfm.exec.addShamanObject(anvils[math.random(#anvils)],x+40,y-60,0,(4+power*2)*-1,-8)
  1186.                                 elseif data[name].team == "vermelho" then
  1187.                                     tfm.exec.addShamanObject(anvils[math.random(#anvils)],x-40,y-60,0,4+power*2,-8)
  1188.                                 end
  1189.                             end
  1190.                             if powerups.triple == true then
  1191.                                 if data[name].team == "azul" then
  1192.                                     tfm.exec.addShamanObject(anvils[math.random(#anvils)],x+80,y-60,0,(4+power*2)*-1,-8)
  1193.                                 elseif data[name].team == "vermelho" then
  1194.                                     tfm.exec.addShamanObject(anvils[math.random(#anvils)],x-80,y-60,0,4+power*2,-8)
  1195.                                 end
  1196.                             end
  1197.                         else
  1198.                             if data[name].team == "azul" then
  1199.                                 tfm.exec.addShamanObject(1010,x,y-60,0,(4+power*2)*-1,-8)
  1200.                             elseif data[name].team == "vermelho" then
  1201.                                 tfm.exec.addShamanObject(1010,x,y-60,0,4+power*2,-8)
  1202.                             end
  1203.                         end
  1204.                         anvil_launched=true
  1205.                     end
  1206.                 end
  1207.             end
  1208.             if key >= 49 and key <= 57 then
  1209.                 power=key-48
  1210.                 ui.addTextArea(4003,"<font size='13'><p align='center'>"..text.intensity..": "..power.."",name,320,376,160,24,0x000001,0x000001,1.0,true)
  1211.             end
  1212.             if key == 48 then
  1213.                 power=10
  1214.                 ui.addTextArea(4003,"<font size='13'><p align='center'>"..text.intensity..": "..power.."",name,320,376,160,24,0x000001,0x000001,1.0,true)
  1215.             end
  1216.             if powerups.selective == false then
  1217.                 if valendo == true and reset == false then
  1218.                 if key == 112 then
  1219.                     if tfm.get.room.playerList[name].score >= 6 and powerups.double == false and powerups.triple == false then
  1220.                         if data[name].nivel >= 1 then
  1221.                             powerups.double=true
  1222.                             tfm.exec.setPlayerScore(name,-6,true)
  1223.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.double.."")
  1224.                         else
  1225.                             tfm.exec.chatMessage(text.level_error,name)
  1226.                         end
  1227.                     end
  1228.                 end
  1229.                 if key == 113 then
  1230.                     if tfm.get.room.playerList[name].score >= 12 and powerups.double == false and powerups.triple == false then
  1231.                         if data[name].nivel >= 2 then
  1232.                             powerups.double=true
  1233.                             powerups.triple=true
  1234.                             tfm.exec.setPlayerScore(name,-12,true)
  1235.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.triple.."")
  1236.                         else
  1237.                             tfm.exec.chatMessage(text.level_error,name)
  1238.                         end
  1239.                     end
  1240.                 end
  1241.                 if key == 114 then
  1242.                     if tfm.get.room.playerList[name].score >= 7 and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
  1243.                         if data[name].nivel >= 2 then
  1244.                             powerups.bomba=true
  1245.                             tfm.exec.setPlayerScore(name,-7,true)
  1246.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.bomba1.."")
  1247.                             tfm.exec.chatMessage(text.bomba2,name)
  1248.                             anvil_launched=true
  1249.                             loop=12
  1250.                         else
  1251.                             tfm.exec.chatMessage(text.level_error,name)
  1252.                         end
  1253.                     end
  1254.                 end
  1255.                 if key == 115 then
  1256.                     if tfm.get.room.playerList[name].score >= 6 and powerups.objeto == false then
  1257.                         if data[name].nivel >= 2 then
  1258.                             powerups.objeto=true
  1259.                             tfm.exec.setPlayerScore(name,-6,true)
  1260.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.objeto1.."")
  1261.                             tfm.exec.chatMessage(text.objeto2,name)
  1262.                         else
  1263.                             tfm.exec.chatMessage(text.level_error,name)
  1264.                         end
  1265.                     end
  1266.                 end
  1267.                 if key == 116 then
  1268.                     if tfm.get.room.playerList[name].score >= 25 and powerups.explosion == false and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
  1269.                         if data[name].nivel >= 5 then
  1270.                             powerups.explosion=true
  1271.                             tfm.exec.setPlayerScore(name,-25,true)
  1272.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.exp1.."")
  1273.                             tfm.exec.chatMessage(text.exp2,name)
  1274.                             anvil_launched=true
  1275.                             loop=12
  1276.                         else
  1277.                             tfm.exec.chatMessage(text.level_error,name)
  1278.                         end
  1279.                     end
  1280.                 end
  1281.                 if key == 117 then
  1282.                     if tfm.get.room.playerList[name].score >= 20 and powerups.explosion == false and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
  1283.                         if data[name].nivel >= 6 then
  1284.                             powerups.chuva=true
  1285.                             tfm.exec.setPlayerScore(name,-20,true)
  1286.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.chuva1.."")
  1287.                             tfm.exec.chatMessage(text.chuva2,name)
  1288.                         else
  1289.                             tfm.exec.chatMessage(text.level_error,name)
  1290.                         end
  1291.                     end
  1292.                 end
  1293.                 if key == 118 then
  1294.                     if tfm.get.room.playerList[name].score >= 4 and powerups.fly == false then
  1295.                         if data[name].nivel >= 2 then
  1296.                             powerups.fly=true
  1297.                             tfm.exec.setPlayerScore(name,-4,true)
  1298.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.fly1.."")
  1299.                             tfm.exec.chatMessage(text.fly2,name)
  1300.                         else
  1301.                             tfm.exec.chatMessage(text.level_error,name)
  1302.                         end
  1303.                     end
  1304.                 end
  1305.                 if key == 119 then
  1306.                     if tfm.get.room.playerList[name].score >= 20 and data[name].immortal2 == false then
  1307.                         if data[name].nivel >= 5 then
  1308.                             data[name].immortal=true
  1309.                             data[name].immortal2=true
  1310.                             tfm.exec.setNameColor(name, 0x00ff00)
  1311.                             tfm.exec.setPlayerScore(name,-20,true)
  1312.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.inv1.."")
  1313.                             tfm.exec.chatMessage(text.inv2,name)
  1314.                         else
  1315.                             tfm.exec.chatMessage(text.level_error,name)
  1316.                         end
  1317.                     end
  1318.                 end
  1319.                 if key == 120 then
  1320.                     if tfm.get.room.playerList[name].score >= 14 and powerups.double == false and powerups.triple == false and powerups.objeto == false and powerups.invisible == false then
  1321.                         if data[name].nivel >= 4 then
  1322.                             powerups.invisible=true
  1323.                             tfm.exec.setPlayerScore(name,-14,true)
  1324.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.invi1.."")
  1325.                             tfm.exec.chatMessage(text.invi2,name)
  1326.                         else
  1327.                             tfm.exec.chatMessage(text.level_error,name)
  1328.                         end
  1329.                     end
  1330.                 end
  1331.                 if key == 121 then
  1332.                     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
  1333.                         if data[name].nivel >= 3 then
  1334.                             powerups.selective=true
  1335.                             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 (4pt)<br>F5 = Large Box (6pt)<br>F6 = Large Board (12pt)<br>F7 = Follow-up Box (8pt)<br>F8 = Giant Board (25pt)",actual_player,320,72,160,160,0x424242,0x424242,0.88,true)
  1336.                             tfm.exec.setGameTime(15)
  1337.                             time_limit=15
  1338.                             tfm.exec.setPlayerScore(name,-5,true)
  1339.                             tfm.exec.chatMessage("<VP>"..actual_player.." "..text.selec1.."")
  1340.                             tfm.exec.chatMessage(text.selec2,name)
  1341.                             object=10
  1342.                         else
  1343.                             tfm.exec.chatMessage(text.level_error,name)
  1344.                         end
  1345.                     end
  1346.                 end
  1347.             end
  1348.             else
  1349.                 if key >= 112 and key <= 119 and object == 10 then
  1350.                     if key == 112 then
  1351.                         object=10
  1352.                     elseif key == 113 then
  1353.                         if tfm.get.room.playerList[name].score > 1 then
  1354.                             object=1
  1355.                             tfm.exec.setPlayerScore(name,-1,true)
  1356.                             ui.removeTextArea(701,nil)
  1357.                         end
  1358.                     elseif key == 114 then
  1359.                         if tfm.get.room.playerList[name].score > 2 then
  1360.                             object=39
  1361.                             tfm.exec.setPlayerScore(name,-2,true)
  1362.                             ui.removeTextArea(701,nil)
  1363.                         end
  1364.                     elseif key == 115 then
  1365.                         if tfm.get.room.playerList[name].score > 4 then
  1366.                             object=68
  1367.                             tfm.exec.setPlayerScore(name,-4,true)
  1368.                             ui.removeTextArea(701,nil)
  1369.                         end
  1370.                     elseif key == 116 then
  1371.                         if tfm.get.room.playerList[name].score > 6 then
  1372.                             object=2
  1373.                             tfm.exec.setPlayerScore(name,-6,true)
  1374.                             ui.removeTextArea(701,nil)
  1375.                         end
  1376.                     elseif key == 117 then
  1377.                         if tfm.get.room.playerList[name].score > 12 then
  1378.                             object=4
  1379.                             tfm.exec.setPlayerScore(name,-12,true)
  1380.                             ui.removeTextArea(701,nil)
  1381.                         end
  1382.                     elseif key == 118 then
  1383.                         if tfm.get.room.playerList[name].score > 8 then
  1384.                             object=61
  1385.                             tfm.exec.setPlayerScore(name,-8,true)
  1386.                             ui.removeTextArea(701,nil)
  1387.                         end
  1388.                     elseif key == 119 then
  1389.                         if tfm.get.room.playerList[name].score > 25 then
  1390.                             object=67
  1391.                             tfm.exec.setPlayerScore(name,-25,true)
  1392.                             ui.removeTextArea(701,nil)
  1393.                         end
  1394.                     end
  1395.                 end
  1396.             end
  1397.         end
  1398.     end
  1399. end
  1400. function eventMouse(name,x,y)
  1401.     if powerups.explosion == true and actual_player == name then
  1402.         tfm.exec.explosion(x,y,30,120,true)
  1403.         tfm.exec.displayParticle(12,x,y,0,0,0,0,nil)
  1404.         powerups.explosion=false
  1405.     end
  1406.     if powerups.fly == true and actual_player == name and anvil_launched == false then
  1407.         if data[name].team == "vermelho" then
  1408.             if x < 790 and x > 200 then
  1409.                 tfm.exec.movePlayer(name,x,190,false,0,0,false)
  1410.             end
  1411.         end
  1412.         if data[name].team == "azul" then
  1413.             if x > 810 and x < 1400 then
  1414.                 tfm.exec.movePlayer(name,x,190,false,0,0,false)
  1415.             end
  1416.         end
  1417.     end
  1418. end
  1419. function eventNewGame()
  1420.     advanceLevel()
  1421.     for i=11,297 do
  1422.         ui.removeTextArea(i,nil)
  1423.     end
  1424.     sudden_death=false
  1425.     time_limit=15
  1426.     reset=false
  1427.     count_azul=0
  1428.     count_vermelho=0
  1429.     tempo=0
  1430.     power=5
  1431.     count=0
  1432.     kills=0
  1433.     play_azul={}
  1434.     play_vermelho={}
  1435.     valendo=false
  1436.     loop=8
  1437.     resetPowers()
  1438.     for name,player in pairs(tfm.get.room.playerList) do
  1439.         data[name].kd=math.floor((data[name].kills/data[name].matchs)*100)
  1440.         data[name].killed=-1
  1441.         data[name].team=""
  1442.         data[name].immortal=false
  1443.         data[name].immortal2=false
  1444.         data[name].imatchs=0
  1445.         data[name].skip=0
  1446.         tfm.exec.setNameColor(name,0xd7d7e6)
  1447.         giveCargos(name,data[name].level)
  1448.         for i=32,123 do
  1449.             tfm.exec.bindKeyboard(name,i,true,true)
  1450.         end
  1451.         showTeams(name)
  1452.         for id,name in pairs(avs_list) do
  1453.             if data[name] then
  1454.                 giveCargos(name,2)
  1455.             end
  1456.         end
  1457.         for id,name in pairs(mods_list) do
  1458.             if data[name] then
  1459.                 giveCargos(name,3)
  1460.             end
  1461.         end
  1462.         for id,name in pairs(managers_list) do
  1463.             if data[name] then
  1464.                 giveCargos(name,4)
  1465.             end
  1466.         end
  1467.         for id,name in pairs(admins_list) do
  1468.             if data[name] then
  1469.                 giveCargos(name,5)
  1470.             end
  1471.         end
  1472.     end
  1473.     tfm.exec.setGameTime(30)
  1474.     tfm.exec.chatMessage(text.enter)
  1475. end
  1476. function eventTextAreaCallback(id,name,callback)
  1477.     if callback == "show_menu" then
  1478.         ui.addTextArea(299,"<p align='center'><a href='event:hide_menu'><font size='18'>Menu",name,365,376,70,24,0x000001,0x000001,0.75,true)
  1479.         ui.addTextArea(298,text.menu_bar,name,200,345,400,20,0x000001,0x000001,0.80,true)
  1480.     end
  1481.     if callback == "hide_menu" then
  1482.         ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,376,70,24,0x000001,0x000001,0.75,true)
  1483.         ui.removeTextArea(298,name)
  1484.     end
  1485.     if callback == "ranking" then
  1486.         eventChatCommand(name,"rank")
  1487.     end
  1488.     if callback == "cap" then
  1489.         eventChatCommand(name,"cap")
  1490.     end
  1491.     if callback == "cmd" then
  1492.         eventChatCommand(name,"cmd")
  1493.     end
  1494.     if callback == "powerups" then
  1495.         loadPowerups(name)
  1496.     end
  1497.     if callback == "power1" then
  1498.         tfm.exec.chatMessage(text.double2,name)
  1499.     end
  1500.     if callback == "help" then
  1501.         eventChatCommand(name,"help")
  1502.     end
  1503.     if callback == "power2" then
  1504.         tfm.exec.chatMessage(text.triple2,name)
  1505.     end
  1506.     if callback == "power3" then
  1507.         tfm.exec.chatMessage(text.bomba2,name)
  1508.     end
  1509.     if callback == "power4" then
  1510.         tfm.exec.chatMessage(text.objeto2,name)
  1511.     end
  1512.     if callback == "power5" then
  1513.         tfm.exec.chatMessage(text.exp2,name)
  1514.     end
  1515.     if callback == "power6" then
  1516.         tfm.exec.chatMessage(text.chuva2,name)
  1517.     end
  1518.     if callback == "power7" then
  1519.         tfm.exec.chatMessage(text.fly2,name)
  1520.     end
  1521.     if callback == "power8" then
  1522.         tfm.exec.chatMessage(text.inv2,name)
  1523.     end
  1524.     if callback == "power9" then
  1525.         tfm.exec.chatMessage(text.invi2,name)
  1526.     end
  1527.     if callback == "power10" then
  1528.         tfm.exec.chatMessage(text.selec2,name)
  1529.     end
  1530.     if callback == "profile" then
  1531.         tfm.exec.chatMessage(text.profile,name)
  1532.     end
  1533.     if callback == "fechar" then
  1534.         for id=8000,8010 do
  1535.             ui.removeTextArea(id,name)
  1536.         end
  1537.     end
  1538.     if callback == "close" then
  1539.         for id=8000,8010 do
  1540.             ui.removeTextArea(id,name)
  1541.             ui.removeTextArea(6969+id,name)
  1542.             ui.removeTextArea(7979+id,name)
  1543.         end
  1544.     end
  1545.     if callback == "closep" then
  1546.         for id=9000,9010 do
  1547.             ui.removeTextArea(id,name)
  1548.         end
  1549.     end
  1550.     if callback == "enter_vermelho" then
  1551.         if data[name].killed == -1 and data[name].team == "" then
  1552.             data[name].team="vermelho"
  1553.             data[name].killed=0
  1554.             tfm.exec.respawnPlayer(name)
  1555.             tfm.exec.movePlayer(name,700,180,false,0,0,false)
  1556.             count_vermelho=count_vermelho+1
  1557.             ui.removeTextArea(41,name)
  1558.             ui.removeTextArea(42,name)
  1559.             ui.addTextArea(51,"<p align='center'><a href='event:sair_vermelho'>"..text.exit.."",name,300,180,200,20,0x505050,0x323232,1.0,true)
  1560.         end
  1561.     end
  1562.     if callback == "enter_azul" then
  1563.         if data[name].killed == -1 and data[name].team == "" then
  1564.             data[name].team="azul"
  1565.             data[name].killed=0
  1566.             tfm.exec.respawnPlayer(name)
  1567.             tfm.exec.movePlayer(name,900,180,false,0,0,false)
  1568.             count_azul=count_azul+1
  1569.             ui.removeTextArea(41,name)
  1570.             ui.removeTextArea(42,name)
  1571.             ui.addTextArea(52,"<p align='center'><a href='event:sair_azul'>"..text.exit.."",name,300,180,200,20,0x505050,0x323232,1.0,true)
  1572.         end
  1573.     end
  1574.     if callback == "sair_azul" then
  1575.         data[name].team=""
  1576.         data[name].killed=-1
  1577.         tfm.exec.killPlayer(name)
  1578.         count_azul=count_azul-1
  1579.         ui.removeTextArea(52,name)
  1580.         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)
  1581.         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)
  1582.     end
  1583.     if callback == "sair_vermelho" then
  1584.         data[name].team=""
  1585.         data[name].killed=-1
  1586.         tfm.exec.killPlayer(name)
  1587.         count_vermelho=count_vermelho-1
  1588.         ui.removeTextArea(51,name)
  1589.         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)
  1590.         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)
  1591.     end
  1592. end
  1593. function winRed()
  1594.     for name,player in pairs(tfm.get.room.playerList) do
  1595.         if data[name].team == "vermelho" then
  1596.             data[name].exp=data[name].exp+20
  1597.             data[name].wins=data[name].wins+1
  1598.             data[name].score=data[name].score+15
  1599.             tfm.exec.respawnPlayer(name)
  1600.             tfm.exec.movePlayer(name,math.random(225,775),170,false,0,0,false)
  1601.             tfm.exec.playEmote(name,0)
  1602.         end
  1603.     end
  1604.     advanceLevel()
  1605. end
  1606. function winAzul()
  1607.     for name,player in pairs(tfm.get.room.playerList) do
  1608.         if data[name].team == "azul" then
  1609.             data[name].exp=data[name].exp+20
  1610.             data[name].wins=data[name].wins+1
  1611.             data[name].score=data[name].score+15
  1612.             tfm.exec.respawnPlayer(name)
  1613.             tfm.exec.movePlayer(name,math.random(825,1375),170,false,0,0,false)
  1614.             tfm.exec.playEmote(name,0)
  1615.         end
  1616.     end
  1617.     advanceLevel()
  1618. end
  1619. function advanceLevel()
  1620.     for name,player in pairs(tfm.get.room.playerList) do
  1621.         if data[name].exp >= data[name].maxp then
  1622.             data[name].exp=data[name].exp-data[name].maxp
  1623.             data[name].maxp=data[name].maxp+50
  1624.             data[name].nivel=data[name].nivel+1
  1625.             tfm.exec.chatMessage(""..text.advanced..""..data[name].nivel.."!",name)
  1626.         end
  1627.     end
  1628. end
  1629. function giveCargos(name,type)
  1630.     if type == 1 and data[name] then
  1631.         data[name].level=1
  1632.         tfm.exec.setNameColor(name,0x00E8FF)
  1633.     elseif type == 2 and data[name] then
  1634.         data[name].level=2
  1635.         tfm.exec.setNameColor(name,0x0076FF)
  1636.     elseif type == 3 and data[name] then
  1637.         data[name].level=3
  1638.         tfm.exec.setNameColor(name,0xFFFB00)
  1639.     elseif type == 4 and data[name] then
  1640.         data[name].level=4
  1641.         tfm.exec.setNameColor(name,0xFF7100)
  1642.     elseif type == 5 and data[name] then
  1643.         data[name].level=5
  1644.         tfm.exec.setNameColor(name,0xFF0000)
  1645.     end
  1646. end
  1647. end
  1648.  
  1649. initMestre = function()
  1650. tfm.exec.disableAutoNewGame(true)
  1651. tfm.exec.disableAutoShaman(true)
  1652. tfm.exec.disableAutoTimeLeft(true)
  1653. tfm.exec.disableAutoScore(true)
  1654. tfm.exec.disableAfkDeath(true)
  1655. tfm.exec.setRoomMaxPlayers(35)
  1656. mapas={6788085,6788183,6789853,6791944,6792470,6808957,6810292,6821950,6830799,6866406,6866549,6788693,6788728,6859175,6834529,6866437,6812488,6876638,6876563,6885971,6888512,6893463,6900149,6907177,6892608,6982387,5328362,5957905,7055459,7290270,7290275,7404106,7404327,7382263,7394517,7405103,7400694,7400678,7412412,7412422,7431981}
  1657. active=0 -- códigos active: -2 = número de ratos insuficiente, -1 = partida encerrada, 0 = partida não iniciada ou intervalo e 1 ou mais = comandos operando
  1658. vivo=0 -- número de ratos vivos
  1659. rato=0 -- número de ratos na sala
  1660. dificuldade=1 -- dificuldade da partida (alterada automaticamente)
  1661. rodadas=0 -- o limite de rodadas das partidas é calculado automaticamente
  1662. string="" -- variável usada no comando 36
  1663. rodada=0 -- número da rodada atual, não altere
  1664. number=0 -- variável usada no comando 12
  1665. xpos=0 -- variável usada nos comandos 22, 23 e 24
  1666. ypos=0 -- variável usada nos comandos 25 e 26
  1667. data={} -- variável que define os dados dos jogadores
  1668. lang={} -- não alterar, variável que define a linguagem dos textos
  1669. pergunta="" -- variável usada no comando 35
  1670. resposta="" -- variável usada no comando 35
  1671. tempo=10 -- variável usada no comando 35
  1672. unlocked=true -- bloqueia ou desbloqueia a execução do script
  1673. for _,f in next,{"help","rodar","command","limite","q","r","time"} do
  1674.     system.disableChatCommandDisplay(f)
  1675. end
  1676. --[[ Aqui vão as mensagens e suas devidas traduções, não se esqueça de por a vírgula após cada comando. ]]--
  1677.  
  1678. lang.br = {
  1679.     welcome = "<N>Bem-vindo a sala Mestre Mandou! Nesta sala seu objetivo é fazer tudo o que o script mandar.<ROSE><br>Deseja ver mais ajuda? Digite !help.<br><VP>Script criado por Jessiewind26#2546 - Versão RTM Compilação 15",
  1680.     dancar = "Dance!",
  1681.     sentar = "Sente!",
  1682.     confetar = "Atire 5 confetes!",
  1683.     mouse = "Clique na tela 10 vezes!",
  1684.     beijos = "Dê 10 beijos!",
  1685.     palmas = "Bata palmas 5 vezes!",
  1686.     dormir = "Vocês estão com sono. Durmam para descansar.",
  1687.     raiva = "Tigrounette é do mal! Fiquem com raiva dele!",
  1688.     chorem = "Vocês não ganharam queijo :( Chorem!",
  1689.     esquerda = "Não vá para a esquerda!",
  1690.     direita = "Não vá para a direita!",
  1691.     numero = "Digite o seguinte número: ",
  1692.     digitar = "Digite qualquer coisa e mande para mim.",
  1693.     falar = "Não falem nada!",
  1694.     pular = "Não pulem!",
  1695.     mexer = "Não se mexam!",
  1696.     bandeira = "Balance a bandeira de qualquer país!",
  1697.     ano = "Em que ano estamos?",
  1698.     vesquerda = "Fique virado para a esquerda!",
  1699.     vdireita = "Fique virado para a direita!",
  1700.     quadrado = "Fique no quadrado branco!",
  1701.     retangulo = "Fique dentro do retângulo branco!",
  1702.     nretangulo = "Não fique dentro do retângulo branco!",
  1703.     preesquerda30 = "Pressione 30 vezes a tecla para ESQUERDA!",
  1704.     predireita30 = "Pressione 30 vezes a tecla para DIREITA!",
  1705.     preesquerda60 = "Pressione 60 vezes a tecla para ESQUERDA!",
  1706.     predireita60 = "Pressione 60 vezes a tecla para DIREITA!",
  1707.     espaco = "Pressione a barra de espaço 20 vezes!",
  1708.     nome = "Digite o seu nome no jogo (com #número).",
  1709.     ndance = "Não dance!",
  1710.     mestre = "Mestre Mandou",
  1711.     map = "Mapa",
  1712.     time = "Tempo",
  1713.     mice = "Ratos",
  1714.     round = "Rodada",
  1715.     mices = "Esta sala requer pelo menos 4 ratos.",
  1716.     difficulty = "Dificuldade",
  1717.     creator = "Module criado por Jessiewind26#2546",
  1718.     segundos = "segundos.",
  1719.     fim = "Partida encerrada! Próxima partida iniciando em "
  1720. }
  1721. lang.en = {
  1722.     welcome = "<N>Welcome to script Master Says! On this module you have to do everything that the master says.<ROSE><br>If you want help, type !help.<br><VP>Module created by Jessiewind26#2546 - Version RTM Compilation 15",
  1723.     dancar = "Dance!",
  1724.     sentar = "Sit!",
  1725.     confetar = "Throw 5 confetti!",
  1726.     mouse = "Click on screen 10 times!",
  1727.     beijos = "Give 10 kisses!",
  1728.     palmas = "Clap 5 times!",
  1729.     dormir = "They are sleepy. Sleep to rest.",
  1730.     raiva = "Tigrounette is evil! Get angry with him!",
  1731.     chorem = "No cheese for you. Cry!",
  1732.     esquerda = "Don't go to the LEFT!",
  1733.     direita = "Don't go to the RIGHT!",
  1734.     numero = "Type this number: ",
  1735.     digitar = "Type anything and send to me.",
  1736.     falar = "Don't speak nothing!",
  1737.     pular = "Don't jump!",
  1738.     mexer = "Don't move!",
  1739.     bandeira = "Balance the flag of anything country!",
  1740.     ano = "What year are we?",
  1741.     vesquerda = "Stay facing LEFT!",
  1742.     vdireita = "Stay facing RIGHT!",
  1743.     quadrado = "Stay on the white square!",
  1744.     retangulo = "Stay on the white rectangle!",
  1745.     nretangulo = "Don't stay on the white rectangle!",
  1746.     preesquerda30 = "Press 30 times the LEFT key!",
  1747.     predireita30 = "Press 30 times the RIGHT key!",
  1748.     preesquerda60 = "Press 60 times the LEFT key!",
  1749.     predireita60 = "Press 60 times the RIGHT key!",
  1750.     espaco = "Press 20 times the SPACEBAR!",
  1751.     nome = "Type your nickname (with #number)!",
  1752.     ndance = "Don't dance!",
  1753.     mestre = "Master Says",
  1754.     map = "Map",
  1755.     time = "Time",
  1756.     mice = "Mice",
  1757.     round = "Round",
  1758.     mices = "This room requires at least 4 players.",
  1759.     difficulty = "Difficulty",
  1760.     creator = "Module created by Jessiewind26#2546",
  1761.     segundos = "seconds.",
  1762.     fim = "End of match! The next match will start on "
  1763. }
  1764.  
  1765. --[[ Fim das traduções. ]]--
  1766.  
  1767. if tfm.get.room.community == "br" then
  1768.     text = lang.br
  1769. else
  1770.     text = lang.en
  1771. end
  1772. function eventNewPlayer(name)
  1773.     rato=rato+1
  1774.     for k=32, 87 do
  1775.         tfm.exec.bindKeyboard(name,k,false,true)
  1776.     end
  1777.     system.bindMouse(name,true)
  1778.     newData={
  1779.             ["c"]=0;
  1780.             ["s"]=0;
  1781.             };     
  1782.     data[name] = newData;
  1783.     tfm.exec.chatMessage(""..text.welcome.."",name)
  1784. end
  1785. for name,player in pairs(tfm.get.room.playerList) do
  1786.     eventNewPlayer(name)
  1787. end
  1788. function eventPlayerDied(name)
  1789.     if active >= 0 then
  1790.         vivo=vivo-1
  1791.         local i=0
  1792.         local name
  1793.         for pname,player in pairs(tfm.get.room.playerList) do
  1794.             if not player.isDead then
  1795.                 i=i+1
  1796.                 name=pname
  1797.             end
  1798.         end
  1799.         if i==0 then
  1800.             active=-1
  1801.         elseif i==1 then
  1802.             active=-1
  1803.             tfm.exec.giveCheese(name)
  1804.             tfm.exec.playerVictory(name)
  1805.             tfm.exec.setGameTime(10)
  1806.         end
  1807.     end
  1808. end
  1809. function eventNewGame()
  1810.     ui.removeTextArea(0,nil)
  1811.     rodada=0
  1812.     active=0
  1813.     vivo=0
  1814.     rato=0
  1815.     dificuldade=1
  1816.     if unlocked == true then
  1817.         tfm.exec.setGameTime(24)
  1818.     else
  1819.         tfm.exec.setGameTime(36000)
  1820.     end
  1821.     for name,player in pairs(tfm.get.room.playerList) do
  1822.         vivo=vivo+1
  1823.         rato=rato+1
  1824.         data[name].c=0
  1825.     end
  1826.     rodadas=math.floor(10+(rato/2))
  1827. end
  1828. function eventPlayerLeft()
  1829.     rato=rato-1
  1830. end
  1831. function sortearComandos()
  1832.     active=math.random(1,34) -- Importante: Altere o segundo número conforme a quantidade de comandos presentes no script.
  1833.     getCommand()
  1834. end
  1835. function eventChatCommand(name,message)
  1836.     if message == "help" then
  1837.         tfm.exec.chatMessage(""..text.welcome.."",name)
  1838.     end
  1839.    
  1840.     --[[ Comando usado para testar mapas das pessoas. ]]--
  1841.  
  1842.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" or name == admin then
  1843.         if(message:sub(0,5) == "rodar") then
  1844.                 tfm.exec.newGame(message:sub(7))
  1845.         end
  1846.     end
  1847.  
  1848.     --[[ Comando usado para rodar algum comando manualmente. ]]--
  1849.  
  1850.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" then
  1851.         if(message:sub(0,7) == "command") then
  1852.                 active=tonumber(message:sub(9))
  1853.                 getCommand()
  1854.         end
  1855.     end
  1856.  
  1857.     --[[ Comando usado para alterar o limite de ratos na sala. ]]--
  1858.  
  1859.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" or name == admin then
  1860.         if(message:sub(0,6) == "limite") then
  1861.             tfm.exec.setRoomMaxPlayers(message:sub(8))
  1862.         end
  1863.     end
  1864.  
  1865.     --[[ Comando usado para definir uma senha na sala. ]]--
  1866.  
  1867.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" or name == admin then
  1868.         if(message:sub(0,2) == "pw") then
  1869.             if message:sub(4) == "" then
  1870.                 tfm.exec.setRoomPassword("")
  1871.                 tfm.exec.chatMessage("Password cleared.",name)
  1872.             else
  1873.                 tfm.exec.setRoomPassword(message:sub(4))
  1874.                 tfm.exec.chatMessage("Password: "..message:sub(4).."",name)
  1875.             end
  1876.         end
  1877.     end
  1878.  
  1879.     --[[ Comando usado para alterar a pergunta utilizada no comando 37. ]]--
  1880.  
  1881.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" then
  1882.         if(message:sub(0,1) == "q") then
  1883.             pergunta=message:sub(3)
  1884.         end
  1885.     end
  1886.  
  1887.     --[[ Comando usado para alterar a resposta da pergunta utilizada no comando 37. ]]--
  1888.  
  1889.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" then
  1890.         if(message:sub(0,1) == "r") then
  1891.             resposta=message:sub(3)
  1892.         end
  1893.     end
  1894.  
  1895.     --[[ Comando usado para alterar o tempo da pergunta utilizada no comando 37. ]]--
  1896.  
  1897.     if name == "Jessiewind26#2546" or name == "Varusofeyzan#0000" then
  1898.         if(message:sub(0,4) == "time") then
  1899.             tempo=message:sub(6)
  1900.         end
  1901.     end
  1902.  
  1903. end
  1904. function getCommand()
  1905.     rodada=rodada+1
  1906.     for name,player in pairs(tfm.get.room.playerList) do
  1907.         data[name].c=0
  1908.         data[name].s=0
  1909.     end
  1910.  
  1911.     --[[ Aqui vai os números dos comandos, o tempo para executá-los e a variável com o texto a ser exibido. ]]--
  1912.  
  1913.     if active == 1 then
  1914.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.dancar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1915.         tfm.exec.setGameTime(5)
  1916.     end
  1917.     if active == 2 then
  1918.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.sentar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1919.         tfm.exec.setGameTime(5)
  1920.     end
  1921.     if active == 3 then
  1922.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.confetar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1923.         tfm.exec.setGameTime(6)
  1924.     end
  1925.     if active == 4 then
  1926.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.mouse.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1927.         tfm.exec.setGameTime(6)
  1928.     end
  1929.     if active == 5 then
  1930.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.beijos.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1931.         tfm.exec.setGameTime(15)
  1932.     end
  1933.     if active == 6 then
  1934.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.palmas.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1935.         tfm.exec.setGameTime(8)
  1936.     end
  1937.     if active == 7 then
  1938.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.dormir.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1939.         tfm.exec.setGameTime(5)
  1940.     end
  1941.     if active == 8 then
  1942.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.raiva.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1943.         tfm.exec.setGameTime(5)
  1944.     end
  1945.     if active == 9 then
  1946.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.chorem.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1947.         tfm.exec.setGameTime(5)
  1948.     end
  1949.     if active == 10 then
  1950.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.esquerda.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1951.         tfm.exec.setGameTime(8)
  1952.         for name,player in pairs(tfm.get.room.playerList) do
  1953.             data[name].c=1 -- isto indica que todos permanecerão vivos
  1954.         end
  1955.     end
  1956.     if active == 11 then
  1957.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.direita.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1958.         tfm.exec.setGameTime(8)
  1959.         for name,player in pairs(tfm.get.room.playerList) do
  1960.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  1961.         end
  1962.     end
  1963.     if active == 12 then
  1964.         number=math.random(1000000,9999999)
  1965.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.numero..""..number.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1966.         tfm.exec.setGameTime(10)
  1967.     end
  1968.     if active == 13 then
  1969.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.digitar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1970.         tfm.exec.setGameTime(7)
  1971.     end
  1972.     if active == 14 then
  1973.         number=math.random(100000000,999999999)
  1974.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.numero..""..number.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1975.         tfm.exec.setGameTime(11)
  1976.     end
  1977.     if active == 15 then
  1978.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.falar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1979.         tfm.exec.setGameTime(5)
  1980.         for name,player in pairs(tfm.get.room.playerList) do
  1981.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  1982.         end
  1983.     end
  1984.     if active == 16 then
  1985.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.pular.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1986.         tfm.exec.setGameTime(5)
  1987.         for name,player in pairs(tfm.get.room.playerList) do
  1988.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  1989.         end
  1990.     end
  1991.     if active == 17 then
  1992.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.mexer.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  1993.         tfm.exec.setGameTime(5)
  1994.         for name,player in pairs(tfm.get.room.playerList) do
  1995.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  1996.         end
  1997.     end
  1998.     if active == 18 then
  1999.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.bandeira.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2000.         tfm.exec.setGameTime(8)
  2001.     end
  2002.     if active == 19 then
  2003.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.ano.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2004.         tfm.exec.setGameTime(5)
  2005.     end
  2006.     if active == 20 then
  2007.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.vesquerda.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2008.         tfm.exec.setGameTime(5)
  2009.         for name,player in pairs(tfm.get.room.playerList) do
  2010.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2011.         end
  2012.     end
  2013.     if active == 21 then
  2014.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.vdireita.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2015.         tfm.exec.setGameTime(5)
  2016.         for name,player in pairs(tfm.get.room.playerList) do
  2017.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2018.         end
  2019.     end
  2020.     if active == 22 then
  2021.         xpos=math.random(60,650) -- calcula aleatoriamente a posição do quadrado branco
  2022.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.quadrado.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2023.         tfm.exec.setGameTime(5)
  2024.         for name,player in pairs(tfm.get.room.playerList) do
  2025.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2026.         end
  2027.         ui.addTextArea(1,"",nil,xpos,320,80,65,0xffffff,0xffffff,0.68,false)
  2028.     end
  2029.     if active == 23 then
  2030.         xpos=math.random(60,650) -- calcula aleatoriamente a posição do retângulo branco
  2031.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.retangulo.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2032.         tfm.exec.setGameTime(5)
  2033.         for name,player in pairs(tfm.get.room.playerList) do
  2034.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2035.         end
  2036.         ui.addTextArea(1,"",nil,xpos,0,80,400,0xffffff,0xffffff,0.68,false)
  2037.     end
  2038.     if active == 24 then
  2039.         xpos=math.random(60,650) -- calcula aleatoriamente a posição do retângulo branco
  2040.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.nretangulo.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2041.         tfm.exec.setGameTime(5)
  2042.         for name,player in pairs(tfm.get.room.playerList) do
  2043.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2044.         end
  2045.         ui.addTextArea(1,"",nil,xpos,0,80,400,0xffffff,0xffffff,0.68,false)
  2046.     end
  2047.     if active == 25 then
  2048.         ypos=math.random(40,300) -- calcula aleatoriamente a posição do retângulo branco
  2049.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.retangulo.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2050.         tfm.exec.setGameTime(5)
  2051.         for name,player in pairs(tfm.get.room.playerList) do
  2052.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2053.         end
  2054.         ui.addTextArea(1,"",nil,0,ypos,1600,60,0xffffff,0xffffff,0.68,false)
  2055.     end
  2056.     if active == 26 then
  2057.         ypos=math.random(40,300) -- calcula aleatoriamente a posição do retângulo branco
  2058.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.nretangulo.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2059.         tfm.exec.setGameTime(5)
  2060.         for name,player in pairs(tfm.get.room.playerList) do
  2061.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2062.         end
  2063.         ui.addTextArea(1,"",nil,0,ypos,1600,60,0xffffff,0xffffff,0.68,false)
  2064.     end
  2065.     if active == 27 then
  2066.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.preesquerda30.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2067.         tfm.exec.setGameTime(9)
  2068.     end
  2069.     if active == 28 then
  2070.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.predireita30.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2071.         tfm.exec.setGameTime(9)
  2072.     end
  2073.     if active == 29 then
  2074.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.preesquerda60.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2075.         tfm.exec.setGameTime(15)
  2076.     end
  2077.     if active == 30 then
  2078.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.predireita60.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2079.         tfm.exec.setGameTime(15)
  2080.     end
  2081.     if active == 31 then
  2082.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.espaco.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2083.         tfm.exec.setGameTime(7)
  2084.     end
  2085.     if active == 32 then
  2086.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.nome.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2087.         tfm.exec.setGameTime(12)
  2088.     end
  2089.     if active == 33 then
  2090.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.ndance.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2091.         tfm.exec.setGameTime(6)
  2092.         for name,player in pairs(tfm.get.room.playerList) do
  2093.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  2094.         end
  2095.     end
  2096.     if active == 34 then
  2097.         local number1=math.random(1000000,9999999)
  2098.         local number2=math.random(1000000,9999999)
  2099.         string=tostring(number1..number2)
  2100.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.numero..""..string.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2101.         tfm.exec.setGameTime(15)
  2102.     end
  2103.     if active == 35 then
  2104.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..pergunta.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  2105.         tfm.exec.setGameTime(tempo)
  2106.     end
  2107.  
  2108.     --[[ Fim da descrição dos comandos. ]]--
  2109.  
  2110. end
  2111.  
  2112. --[[ Operações com ações (dança, sentar...)
  2113. Utilize data[name].c=1 para informar ao código que o comando foi executado.
  2114. Caso haja necessidade de fazer a mesma ação por mais de uma vez, utilize a variável data[name].s conforme mostrado no código. ]]--
  2115.  
  2116. function eventChatMessage(name,message)
  2117.     if active == 12 or active == 14 or active == 34 then
  2118.         if message == tostring(number) or message == string then
  2119.             data[name].c=1
  2120.         end
  2121.     end
  2122.     if active == 13 then
  2123.         data[name].c=1
  2124.     end
  2125.     if active == 15 then
  2126.         tfm.exec.killPlayer(name)
  2127.     end
  2128.     if active == 19 then
  2129.         if message == "2018" then
  2130.             data[name].c=1
  2131.         end
  2132.     end
  2133.     if active == 32 then
  2134.         if string.upper(message) == string.upper(name) then
  2135.             data[name].c=1
  2136.         end
  2137.     end
  2138.     if active == 35 then
  2139.         if string.upper(message) == string.upper(resposta) then
  2140.             data[name].c=1
  2141.         end
  2142.     end
  2143. end
  2144. function eventEmotePlayed(name,id)
  2145.     if active == 1 then
  2146.         if id == 0 or id == 10 then
  2147.             data[name].c=1
  2148.         end
  2149.     end
  2150.     if active == 2 then
  2151.         if id == 8 then
  2152.             data[name].c=1
  2153.         end
  2154.     end
  2155.     if active == 3 then
  2156.         if id == 9 then
  2157.             data[name].s=data[name].s+1
  2158.             if data[name].s >= 5 then
  2159.                 data[name].c=1
  2160.             end
  2161.         end
  2162.     end
  2163.     if active == 5 then
  2164.         if id == 3 then
  2165.             data[name].s=data[name].s+1
  2166.             if data[name].s >= 10 then
  2167.                 data[name].c=1
  2168.             end
  2169.         end
  2170.     end
  2171.     if active == 6 then
  2172.         if id == 5 then
  2173.             data[name].s=data[name].s+1
  2174.             if data[name].s >= 5 then
  2175.                 data[name].c=1
  2176.             end
  2177.         end
  2178.     end
  2179.     if active == 7 then
  2180.         if id == 6 then
  2181.             data[name].c=1
  2182.         end
  2183.     end
  2184.     if active == 8 then
  2185.         if id == 4 then
  2186.             data[name].c=1
  2187.         end
  2188.     end
  2189.     if active == 9 then
  2190.         if id == 2 then
  2191.             data[name].c=1
  2192.         end
  2193.     end
  2194.     if active == 17 then
  2195.         tfm.exec.killPlayer(name)
  2196.     end
  2197.     if active == 18 then
  2198.         if id == 10 then
  2199.             data[name].c=1
  2200.         end
  2201.     end
  2202.     if active == 33 then
  2203.         if id == 0 or id == 10 then
  2204.             tfm.exec.killPlayer(name)
  2205.         end
  2206.     end
  2207. end
  2208. function eventMouse(name,x,y)
  2209.     if active == 4 then
  2210.         data[name].s=data[name].s+1
  2211.         if data[name].s >= 10 then
  2212.             data[name].c=1
  2213.         end
  2214.     end
  2215. end
  2216. function eventKeyboard(name,id,down,x,y)
  2217.     if active == 10 then
  2218.         if id == 37 or id == 65 then
  2219.             tfm.exec.killPlayer(name)
  2220.         end
  2221.     end
  2222.     if active == 11 then
  2223.         if id == 39 or id == 68 then
  2224.             tfm.exec.killPlayer(name)
  2225.         end
  2226.     end
  2227.     if active == 16 then
  2228.         if id == 38 or id == 87 then
  2229.             tfm.exec.killPlayer(name)
  2230.         end
  2231.     end
  2232.     if active == 17 then
  2233.         if id == 38 or id == 87 or id == 37 or id == 65 or id == 39 or id == 68 or id == 40 or id == 83 then
  2234.             tfm.exec.killPlayer(name)
  2235.         end
  2236.     end
  2237.     if active == 27 then
  2238.         if id == 37 or id == 65 then
  2239.             data[name].s=data[name].s+1
  2240.             if data[name].s >= 30 then
  2241.                 data[name].c=1
  2242.             end
  2243.         end
  2244.     end
  2245.     if active == 28 then
  2246.         if id == 39 or id == 68 then
  2247.             data[name].s=data[name].s+1
  2248.             if data[name].s >= 30 then
  2249.                 data[name].c=1
  2250.             end
  2251.         end
  2252.     end
  2253.     if active == 29 then
  2254.         if id == 37 or id == 65 then
  2255.             data[name].s=data[name].s+1
  2256.             if data[name].s >= 60 then
  2257.                 data[name].c=1
  2258.             end
  2259.         end
  2260.     end
  2261.     if active == 30 then
  2262.         if id == 39 or id == 68 then
  2263.             data[name].s=data[name].s+1
  2264.             if data[name].s >= 60 then
  2265.                 data[name].c=1
  2266.             end
  2267.         end
  2268.     end
  2269.     if active == 31 then
  2270.         if id == 32 then
  2271.             data[name].s=data[name].s+1
  2272.             if data[name].s >= 15 then
  2273.                 data[name].c=1
  2274.             end
  2275.         end
  2276.     end
  2277. end
  2278.  
  2279. --[[ Fim das operações com ações. ]]--
  2280.  
  2281. function eventLoop(passado,faltando)
  2282.     local tempo=math.floor(faltando/1000)
  2283.     if active == -2 then
  2284.         ui.setMapName("<N>"..text.mices.."<")
  2285.     elseif active == -1 then
  2286.         ui.setMapName("<VP>"..text.fim.."<b>"..tempo.."</b> "..text.segundos.."<")
  2287.     else
  2288.         ui.setMapName("<J>"..tfm.get.room.currentMap.."   <G>|  <N>"..text.time.." : <V>"..tempo.."s   <G>|  <N>"..text.mice.." : <VP>"..vivo.." <N>/ <V>"..rato.."   <G>|   <N>"..text.round.." : <V>"..rodada.."/"..rodadas.."   <G>|  <N>"..text.difficulty.." : <V>"..dificuldade.."<")
  2289.     end
  2290.     if active >= 0 then
  2291.         if passado > 1200 and passado < 1700 and unlocked == true then
  2292.             tfm.exec.chatMessage("Playing map <J>"..tfm.get.room.currentMap.."<BL> created by <J>"..tfm.get.room.xmlMapInfo.author)
  2293.         end
  2294.     end
  2295.  
  2296.     --[[ Código que verifica se há pelo menos 4 ratos na sala. ]]--
  2297.  
  2298.     if rato < 4 then
  2299.         if tfm.get.room.currentMap == "@7277839" and unlocked == true then
  2300.             active=-2
  2301.             tfm.exec.setGameTime(8000)
  2302.         else
  2303.             if passado > 3000 and unlocked == true then
  2304.                 tfm.exec.newGame("@7277839")
  2305.                 tfm.exec.setGameTime(8000)
  2306.                 tfm.exec.chatMessage("<R>"..text.mices.."",nil)
  2307.             end
  2308.         end
  2309.     end
  2310.     if rato >= 4 then
  2311.         if tfm.get.room.currentMap == "@7277839" and unlocked == true then
  2312.             tfm.exec.newGame(mapas[math.random(#mapas)])
  2313.             active=0
  2314.         end
  2315.     end
  2316.  
  2317.     if active < 0 and faltando < 1 and unlocked == true then
  2318.         tfm.exec.newGame(mapas[math.random(#mapas)])
  2319.     end
  2320.     if active == 0 and faltando < 1000 then
  2321.         if rodada < rodadas then
  2322.             sortearComandos()
  2323.         else
  2324.             active=-1
  2325.             tfm.exec.setGameTime(10)
  2326.             for name,player in pairs(tfm.get.room.playerList) do
  2327.                 tfm.exec.giveCheese(true)
  2328.                 tfm.exec.playerVictory(true)
  2329.             end
  2330.         end
  2331.     end
  2332.     if active > 0 and faltando < 1 and rato > 1 then
  2333.  
  2334.         --[[ Código necessário para a execução dos comandos 20 e 21. ]]--
  2335.  
  2336.         if active == 20 then
  2337.             for name,player in pairs(tfm.get.room.playerList) do
  2338.                 if tfm.get.room.playerList[name].isFacingRight == true then
  2339.                     tfm.exec.killPlayer(name)
  2340.                 end
  2341.             end
  2342.         end
  2343.         if active == 21 then
  2344.             for name,player in pairs(tfm.get.room.playerList) do
  2345.                 if tfm.get.room.playerList[name].isFacingRight == false then
  2346.                     tfm.exec.killPlayer(name)
  2347.                 end
  2348.             end
  2349.         end
  2350.  
  2351.         --[[ Código necessário para a execução do comando 22. Margens de erro incluídas. ]]--
  2352.  
  2353.         if active == 22 then
  2354.             for name,player in pairs(tfm.get.room.playerList) do
  2355.                 if player.y < 300 then
  2356.                     tfm.exec.killPlayer(name)
  2357.                 else
  2358.                     if player.x < xpos-20 or player.x > xpos+100 then
  2359.                         tfm.exec.killPlayer(name)
  2360.                     end
  2361.                 end
  2362.             end
  2363.         end
  2364.  
  2365.         --[[ Código necessário para a execução do comando 23. ]]--
  2366.  
  2367.         if active == 23 then
  2368.             for name,player in pairs(tfm.get.room.playerList) do
  2369.                 if player.x < xpos or player.x > xpos+80 then
  2370.                     tfm.exec.killPlayer(name)
  2371.                 end
  2372.             end
  2373.         end
  2374.  
  2375.         --[[ Código necessário para a execução do comando 24. ]]--
  2376.  
  2377.         if active == 24 then
  2378.             for name,player in pairs(tfm.get.room.playerList) do
  2379.                 if player.x > xpos and player.x < xpos+80 then
  2380.                     tfm.exec.killPlayer(name)
  2381.                 end
  2382.             end
  2383.         end
  2384.  
  2385.         --[[ Código necessário para a execução do comando 25. Margens de erro incluídas. ]]--
  2386.  
  2387.         if active == 25 then
  2388.             for name,player in pairs(tfm.get.room.playerList) do
  2389.                 if player.y < ypos-10 or player.y > ypos+70 then
  2390.                     tfm.exec.killPlayer(name)
  2391.                 end
  2392.             end
  2393.         end
  2394.  
  2395.         --[[ Código necessário para a execução do comando 26. Margens de erro incluídas. ]]--
  2396.  
  2397.         if active == 26 then
  2398.             for name,player in pairs(tfm.get.room.playerList) do
  2399.                 if player.y > ypos-10 and player.y < ypos+70 then
  2400.                     tfm.exec.killPlayer(name)
  2401.                 end
  2402.             end
  2403.         end
  2404.         ui.removeTextArea(0,nil)
  2405.         ui.removeTextArea(1,nil)
  2406.         active=0
  2407.         if rodada == 8 or rodada == 10 or rodada == 12 or rodada == 14 then
  2408.             dificuldade=dificuldade+1
  2409.         end
  2410.         for name,player in pairs(tfm.get.room.playerList) do
  2411.             if data[name].c == 0 then
  2412.                 tfm.exec.killPlayer(name)
  2413.             end
  2414.         end
  2415.         if vivo > 2 then
  2416.             tfm.exec.setGameTime(7-dificuldade)
  2417.         else
  2418.             tfm.exec.setGameTime(10-dificuldade)
  2419.         end
  2420.     end
  2421.  
  2422.     --[[ Isto faz com que aqueles que cumpram o comando tenham o nome pintado de verde. ]]--
  2423.  
  2424.     for name,player in pairs(tfm.get.room.playerList) do
  2425.         if data[name].c == 1 then
  2426.             tfm.exec.setNameColor(name,0x00ff00)
  2427.         else
  2428.             tfm.exec.setNameColor(name,0xc2c2da)
  2429.         end
  2430.     end
  2431. end
  2432. tfm.exec.newGame("@7277839")
  2433. end
  2434.  
  2435. initWater = function()
  2436. tfm.exec.disableAutoNewGame(true)
  2437. tfm.exec.disableAutoShaman(true)
  2438. tfm.exec.newGame('<C><P DS="m;10,100,1000,100,2000,100,3000,100" L="7000" G="0,7" H="6500" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="3000" o="324650" H="10" Y="-500" T="12" X="1500" /><S L="3000" o="324650" H="10" X="4500" Y="-500" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="3000" L="3000" o="11411" X="0" c="4" Y="3000" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="3000" o="11411" X="3000" c="4" Y="0" T="12" H="3000" /><S H="3000" L="3000" o="11411" X="0" c="4" Y="0" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="3000" o="11411" X="3000" c="4" Y="3000" T="12" H="3000" /><S H="3000" L="3000" o="11411" X="6000" c="4" Y="0" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,,,,0,0,0" L="3000" H="3000" v="1" Y="1792" T="9" X="700" /><S P="0,0,0.3,0.2,0,0,0,0" L="3000" o="11411" X="6000" c="4" Y="3000" T="12" H="3000" /><S P="0,0,,,,0,0,0" L="3000" X="3700" v="1" Y="1792" T="9" H="3000" /><S L="3000" X="6700" H="3000" v="1" Y="1792" T="9" P="0,0,,,,0,0,0" /><S L="800" H="800" X="62" Y="609" T="10" P="0,0,0.3,0,20,0,0,0" /><S L="800" H="800" X="-554" Y="773" T="10" P="0,0,0.3,0,20,0,0,0" /><S L="800" X="1099" H="800" Y="806" T="10" P="0,0,0.3,0,20,0,0,0" /><S L="800" H="300" X="1938" Y="475" T="10" P="0,0,0.3,0,20,0,0,0" /><S L="800" X="2298" H="800" Y="804" T="10" P="0,0,0.3,0,20,0,0,0" /><S L="800" H="800" X="3458" Y="616" T="10" P="0,0,0.3,0,-10,0,0,0" /><S L="800" X="3527" H="800" Y="1150" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="1680" H="800" X="3579" Y="2066" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" H="800" X="4911" Y="1638" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" X="4886" H="800" Y="1082" T="10" P="0,0,0.3,0,-10,0,0,0" /><S L="800" H="800" X="4969" Y="611" T="10" P="0,0,0.3,0,30,0,0,0" /><S L="800" X="5332" H="800" Y="683" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" X="4826" H="600" Y="2416" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="880" H="500" X="4746" Y="3033" T="10" P="0,0,0.3,0,5,0,0,0" /><S L="800" X="4038" H="600" Y="2931" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" H="600" X="3210" Y="2710" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" X="2285" H="800" Y="2778" T="10" P="0,0,0.3,0,-10,0,0,0" /><S L="2000" H="500" X="1967" Y="3260" T="10" P="0,0,0.3,0,14,0,0,0" /><S L="1600" X="436" H="1800" Y="3742" T="10" P="0,0,0.3,0,-1,0,0,0" /><S L="1600" H="800" X="-284" Y="2800" T="10" P="0,0,0.3,0,30,0,0,0" /><S L="1600" X="879" H="800" Y="2004" T="10" P="0,0,0.3,0,-10,0,0,0" /><S L="1600" H="800" X="-752" Y="1848" T="10" P="0,0,0.3,0,-264,0,0,0" /><S L="1000" H="880" X="6232" Y="760" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" X="7125" H="800" Y="743" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="800" H="800" X="6326" Y="1727" T="10" P="0,0,0.3,0,-10,0,0,0" /><S L="1200" X="6445" H="1200" Y="2198" T="10" P="0,0,0.3,0,20,0,0,0" /><S H="3000" L="3000" o="11411" X="5780" c="4" Y="6000" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="1600" H="3000" X="8074" Y="1757" T="10" P="0,0,0.3,0,10,0,0,0" /><S L="1600" X="3674" H="1000" Y="3794" T="10" P="0,0,0.3,0,4,0,0,0" /><S L="640" H="1000" X="2183" Y="1915" T="10" P="0,0,0.3,0,-5,0,0,0" /><S L="1400" H="1200" X="2003" Y="4083" T="10" P="0,0,0.3,0,12,0,0,0" /><S L="3000" X="5640" H="3000" v="1" Y="4792" T="9" P="0,0,,,,0,0,0" /><S L="1200" X="7385" H="3000" Y="4661" T="10" P="0,0,0.3,0,9,0,0,0" /><S L="3000" H="800" X="3404" Y="4777" T="10" P="0,0,0.3,0,8,0,0,0" /><S L="1600" H="2200" X="5675" Y="3854" T="10" P="0,0,0.3,0,99,0,0,0" /><S P="0,0,,,,0,0,0" L="3000" H="3000" v="1" Y="4792" T="9" X="2640" /><S L="3000" H="1800" X="6646" Y="6114" T="10" P="0,0,0.3,0,-21,0,0,0" /><S L="3000" X="4027" H="1800" Y="6240" T="10" P="0,0,0.3,0,37,0,0,0" /></S><D><P P="0,0" Y="3300" T="84" X="1440" /></D><O /><L><VL n="Layer1" l="-1" /><JD c="04969a,250,0.70,1" P1="-1000,422" P2="8000,422" /><JD c="04969a,250,0.70,1" P1="-1000,672" P2="8000,672" /><JD c="04969a,250,0.70,1" P1="-1000,922" P2="8000,922" /><JD c="04969a,250,0.70,1" P1="-1000,1172" P2="8000,1172" /><JD c="04908f,250,0.71,1" P1="-1000,1422" P2="8000,1422" /><JD c="038481,250,0.72,1" P1="-1000,1672" P2="8000,1672" /><JD c="037875,250,0.73,1" P1="-1000,1922" P2="8000,1922" /><JD c="03726d,250,0.74,1" P1="-1000,2172" P2="8000,2172" /><JD c="036666,250,0.75,1" P1="-1000,2422" P2="8000,2422" /><JD c="036060,250,0.76,1" P1="-1000,2672" P2="8000,2672" /><JD c="02545a,250,0.77,1" P1="-1000,2922" P2="8000,2922" /><JD c="024852,250,0.78,1" P1="-1000,3172" P2="8000,3172" /><JD c="02424d,250,0.79,1" P1="-1000,3422" P2="8000,3422" /><JD c="023645,250,0.80,1" P1="-1000,3672" P2="8000,3672" /><JD c="01303f,250,0.81,1" P1="-1000,3922" P2="8000,3922" /><JD c="012437,250,0.82,1" P1="-1000,4172" P2="8000,4172" /><JD c="011828,250,0.84,1" P1="-1000,4422" P2="8000,4422" /><JD c="001220,250,0.86,1" P1="-1000,4672" P2="8000,4672" /><JD c="000816,250,0.88,1" P1="-1000,4922" P2="8000,4922" /><JD c="000612,250,0.90,1" P1="-1000,5172" P2="8000,5172" /><JD c="000310,250,0.92,1" P1="-1000,5422" P2="8000,5422" /><JD c="000108,250,0.94,1" P1="-1000,5672" P2="8000,5672" /><JD c="000006,250,0.96,1" P1="-1000,5922" P2="8000,5922" /><JD c="000005,250,0.98,1" P1="-1000,6172" P2="8000,6172" /><JD c="000004,250,1.00,1" P1="-1000,6422" P2="8000,6422" /><L /></L></Z></C>')
  2439. ui.setMapName("The Darkness Waters - Simple Ocean LUA Map by Ahrizrdbrand#0000<")
  2440. data={}
  2441. function eventNewPlayer(n)
  2442.     newData={
  2443.         ["d"]=0;
  2444.         ["o"]=100;
  2445.             }
  2446.     data[n]=newData;
  2447.     tfm.exec.respawnPlayer(n)
  2448. end
  2449. for name,player in pairs(tfm.get.room.playerList) do
  2450.     eventNewPlayer(name)
  2451. end
  2452. function eventLoop()
  2453.     for name,player in pairs(tfm.get.room.playerList) do
  2454.         if data[name].o > 27.5 then
  2455.             ui.addTextArea(0,"O₂: "..math.floor(data[name].o).."%",name,20,30,70,30,0,0,1.0,true)
  2456.         else
  2457.             ui.addTextArea(0,"<R>O₂: "..math.floor(data[name].o).."%",name,20,30,70,30,0,0,1.0,true)
  2458.         end
  2459.         if tfm.get.room.playerList[name].y < 295 then
  2460.             data[name].d=0
  2461.             if math.floor(data[name].o) <= 99 then
  2462.                 data[name].o=data[name].o+1
  2463.             end
  2464.         else
  2465.             data[name].d=(tfm.get.room.playerList[name].y-295)/20
  2466.             data[name].o=data[name].o-(data[name].d/500)
  2467.         end
  2468.         ui.addTextArea(1,"Deepness: "..data[name].d.."m",name,680,30,130,30,0,0,1.0,true)
  2469.         if data[name].o < 0 then
  2470.             tfm.exec.killPlayer(name)
  2471.             data[name].o=-9999999
  2472.         end
  2473.     end
  2474. end
  2475. end
  2476. initSalto = function()
  2477. tfm.exec.disableAutoNewGame(true)
  2478. data={}
  2479. loop=0
  2480. recorde=1
  2481. tfm.exec.disableAutoShaman(true)
  2482. tfm.exec.disableAutoTimeLeft(true)
  2483. tfm.exec.disableAfkDeath(true)
  2484. tfm.exec.newGame('<C><P F="0" L="27000" H="2900" /><Z><S><S L="10" o="6a7495" X="10995" H="3000" Y="2906" T="5" P="0,0,9999,0,90,0,0,0" /><S L="400" H="184" X="245" Y="680" T="2" P="0,0,0,2,30,0,0,0" /><S L="120" H="2600" X="60" Y="1800" T="6" P="0,0,0.3,0.9,0,0,0,0" /><S L="3000" o="324650" X="1995" H="10" Y="2905" T="5" P="0,0,9999,0.2,0,0,0,0" /><S P="0,0,9999,0.2,0,0,0,0" L="3000" o="324650" H="10" Y="2905" T="5" X="4995" /><S L="3000" o="324650" H="10" X="7995" Y="2906" T="5" P="0,0,9999,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="6a7495" H="3000" Y="7" T="12" X="-3" /><S L="3000" X="1500" H="3000" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" H="3000" X="4500" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" X="7500" H="3000" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" H="3000" X="10500" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" X="13500" H="3000" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" H="3000" X="16500" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" X="19500" H="3000" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" H="3000" X="22500" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" X="25500" H="3000" Y="2100" T="9" P="0,0,,,,0,0,0" /><S L="3000" X="13995" H="10" Y="2906" T="5" P="0,0,9999,0.2,0,0,0,0" /><S L="3000" H="10" X="16995" Y="2906" T="5" P="0,0,9999,0.2,0,0,0,0" /><S L="3000" X="19995" H="10" Y="2906" T="5" P="0,0,9999,0.2,0,0,0,0" /><S L="3000" H="10" X="22995" Y="2906" T="5" P="0,0,9999,0.2,0,0,0,0" /><S L="3000" o="324650" H="10" X="1500" Y="-600" T="12" P="0,0,0,0.2,0,0,0,0" /></S><D><F Y="498" X="58" /><F Y="499" X="29" /><F Y="476" X="60" /><F Y="498" X="85" /><F Y="491" X="48" /><F Y="488" X="72" /><DS Y="488" X="61" /></D><O /></Z></C>')
  2485. system.disableChatCommandDisplay("dddda")
  2486. tfm.exec.addPhysicObject(75,13700,2905,dados2)
  2487. tfm.exec.addPhysicObject(76,16100,2905,dados2)
  2488. tfm.exec.addPhysicObject(77,19100,2905,dados2)
  2489. tfm.exec.addPhysicObject(78,22100,2905,dados2)
  2490. function eventChatCommand(n,m)
  2491.     if m == "dddda" then
  2492.         tfm.exec.chatMessage("Ok",nil)
  2493.         recorde=1
  2494.     end
  2495. end
  2496. function eventPlayerDied(n)
  2497.     tfm.exec.respawnPlayer(n)
  2498. end
  2499. tfm.exec.setUIMapName("Long Jump version v1.8.1 - Script made by Camilledrain#0000 and Rivenbagassa#0000<")
  2500. function eventNewPlayer(n)
  2501.     newData={
  2502.         ["x"]=0;
  2503.         ["x1"]=0;
  2504.         ["x2"]=0;
  2505.         ["y"]=0;
  2506.         ["position"]=0;
  2507.             }
  2508.     data[n]=newData;
  2509.     tfm.exec.respawnPlayer(n)
  2510. end
  2511. for name,player in pairs(tfm.get.room.playerList) do
  2512.     eventNewPlayer(name)
  2513. end
  2514. function eventPlayerDied(n)
  2515.     tfm.exec.respawnPlayer(n)
  2516.     data[n].x1=0
  2517. end
  2518. function eventLoop()
  2519.     loop=loop+1
  2520.     for name,player in pairs(tfm.get.room.playerList) do
  2521.         data[name].y=tfm.get.room.playerList[name].y/-1+550
  2522.         ui.addTextArea(157979,"<font size='15'><font color='#0000ff'>| Altitude: "..data[name].y.." px",name,200,30,800,50,0,0,1.0,true)
  2523.         if tfm.get.room.playerList[name].x < 0 then
  2524.             data[name].x=tfm.get.room.playerList[name].x+19660
  2525.             ui.addTextArea(157978,"<font size='15'><font color='#0000ff'>| Distance: "..data[name].x.." px",name,1,30,800,50,0,0,1.0,true)
  2526.         elseif tfm.get.room.playerList[name].x > 0 and data[name].x2 > 9830 then
  2527.             data[name].x=tfm.get.room.playerList[name].x+19660
  2528.             ui.addTextArea(157978,"<font size='15'><font color='#0000ff'>| Distance: "..data[name].x.." px",name,1,30,800,50,0,0,1.0,true)
  2529.         else
  2530.             data[name].x=tfm.get.room.playerList[name].x
  2531.             ui.addTextArea(157978,"<font size='15'><font color='#0000ff'>| Distance: "..tfm.get.room.playerList[name].x.." px",name,1,30,800,50,0,0,1.0,true)
  2532.         end
  2533.         ui.addTextArea(157977,"<font size='15'><font color='#0000ff'>| Speed: "..tfm.get.room.playerList[name].vx.." px",name,385,30,800,50,0,0,1.0,true)
  2534.         if data[name].y <= -2334 then
  2535.             tfm.exec.setPlayerScore(name,data[name].x,false)
  2536.             tfm.exec.chatMessage("<J>Your distance: <b>"..data[name].x.."</b> pixels.",name)
  2537.             if data[name].x > recorde then
  2538.                 recorde=data[name].x
  2539.                 tfm.exec.chatMessage("<ROSE>New record: <b>"..data[name].x.." pixels</b>, by "..name.."!",nil)
  2540.             end
  2541.             tfm.exec.movePlayer(name,50,200,false,0,0,false)
  2542.             data[name].y=-200
  2543.         end
  2544.     end
  2545. end
  2546. end
  2547.  
  2548. if string.find(tfm.get.room.name,"mestre") then
  2549.     active = "mestre"
  2550.     resetAll()
  2551.     roomAdmin()
  2552.     initMestre()
  2553. elseif string.find(tfm.get.room.name,"ocean") then
  2554.     active = "ocean"
  2555.     resetAll()
  2556.     roomAdmin()
  2557.     initWater()
  2558. elseif string.find(tfm.get.room.name,"longjump") then
  2559.     active = "longjump"
  2560.     resetAll()
  2561.     roomAdmin()
  2562.     initSalto()
  2563. else
  2564.     active = "anvilwar"
  2565.     resetAll()
  2566.     roomAdmin()
  2567.     initAnvilwar()
  2568. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement