Advertisement
Camilledrain_LUA

mestre compilação 9

Jun 9th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[ Texto em PT-BR / Brazilian-Portuguese Text: Script original do module Mestre Mandou (compilação 9). É PROIBIDA REUTILIZAÇÃO EM CAFOFOS DE TRIBO OU EDIÇÕES NO CÓDIGO NÃO AUTORIZADAS. Versão para cafofo da tribo: https://pastebin.com/raw/dC3f5njJ ]]--
  2. --[[ Script Mestre Mandou versão RTM Compilação 9 Criado por Jessiewind26#2546.
  3. Todas as partes do script (ou quase todas) estão explicadas no código.
  4. Esta versão possui 35 comandos. ]]--
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAutoShaman(true)
  7. tfm.exec.disableAutoTimeLeft(true)
  8. tfm.exec.disableAutoScore(true)
  9. tfm.exec.disableAfkDeath(true)
  10. tfm.exec.setRoomMaxPlayers(35)
  11. 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}
  12. 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
  13. vivo=0 -- número de ratos vivos
  14. rato=0 -- número de ratos na sala
  15. dificuldade=1 -- dificuldade da partida (alterada automaticamente)
  16. rodadas=0 -- o limite de rodadas das partidas é calculado automaticamente
  17. rodada=0 -- número da rodada atual, não altere
  18. number=0 -- variável usada no comando 12
  19. xpos=0 -- variável usada nos comandos 22, 23 e 24
  20. ypos=0 -- variável usada nos comandos 25 e 26
  21. data={} -- variável que define os dados dos jogadores
  22. lang={} -- não alterar, variável que define a linguagem dos textos
  23. unlocked=true -- bloqueia ou desbloqueia a execução do script
  24. system.disableChatCommandDisplay("help")
  25. system.disableChatCommandDisplay("rodar")
  26. system.disableChatCommandDisplay("command")
  27. system.disableChatCommandDisplay("msg")
  28. --[[ Aqui vão as mensagens e suas devidas traduções, não se esqueça de por a vírgula após cada comando. ]]--
  29.  
  30. lang.br = {
  31.     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>Mande seus mapas: https://atelier801.com/topic?f=796133&t=915772&p=1#m1<br><VP>Script criado por Jessiewind26#2546 - Versão RTM Compilação 9",
  32.     dancar = "Dance!",
  33.     sentar = "Sente!",
  34.     confetar = "Atire 5 confetes!",
  35.     mouse = "Clique na tela 10 vezes!",
  36.     beijos = "Dê 10 beijos!",
  37.     palmas = "Bata palmas 5 vezes!",
  38.     dormir = "Vocês estão com sono. Durmam para descansar.",
  39.     raiva = "Tigrounette é do mal! Fiquem com raiva dele!",
  40.     chorem = "Vocês não ganharam queijo :( Chorem!",
  41.     esquerda = "Não vá para a esquerda!",
  42.     direita = "Não vá para a direita!",
  43.     numero = "Digite o seguinte número: ",
  44.     digitar = "Digite qualquer coisa e mande para mim.",
  45.     abaixar = "Abaixem!",
  46.     falar = "Não falem nada!",
  47.     pular = "Não pulem!",
  48.     mexer = "Não se mexam!",
  49.     bandeira = "Balance a bandeira de qualquer país!",
  50.     ano = "Em que ano estamos?",
  51.     vesquerda = "Fique virado para a esquerda!",
  52.     vdireita = "Fique virado para a direita!",
  53.     quadrado = "Fique no quadrado branco!",
  54.     retangulo = "Fique dentro do retângulo branco!",
  55.     nretangulo = "Não fique dentro do retângulo branco!",
  56.     preesquerda30 = "Pressione 30 vezes a tecla para ESQUERDA!",
  57.     predireita30 = "Pressione 30 vezes a tecla para DIREITA!",
  58.     preesquerda60 = "Pressione 60 vezes a tecla para ESQUERDA!",
  59.     predireita60 = "Pressione 60 vezes a tecla para DIREITA!",
  60.     espaco = "Pressione a barra de espaço 20 vezes!",
  61.     nome = "Digite o seu nome no jogo (com #número).",
  62.     abracar = "Abrace alguém!",
  63.     beijar = "Beije alguém!",
  64.     ndance = "Não dance!",
  65.     mestre = "Mestre Mandou",
  66.     map = "Mapa",
  67.     time = "Tempo",
  68.     mice = "Ratos",
  69.     round = "Rodada",
  70.     mices = "Esta sala requer pelo menos 4 ratos.",
  71.     difficulty = "Dificuldade",
  72.     creator = "Module criado por Jessiewind26#2546",
  73.     segundos = "segundos.",
  74.     fim = "Partida encerrada! Próxima partida iniciando em "
  75. }
  76. lang.en = {
  77.     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>Send your maps: https://atelier801.com/topic?f=796133&t=915772&p=1#m1<br><VP>Module created by Jessiewind26#2546 - Version RTM Compilation 9",
  78.     dancar = "Dance!",
  79.     sentar = "Sit!",
  80.     confetar = "Throw 5 confetti!",
  81.     mouse = "Click on screen 10 times!",
  82.     beijos = "Give 10 kisses!",
  83.     palmas = "Clap 5 times!",
  84.     dormir = "They are sleepy. Sleep to rest.",
  85.     raiva = "Tigrounette is evil! Get angry with him!",
  86.     chorem = "No cheese for you. Cry!",
  87.     esquerda = "Don't go to the LEFT!",
  88.     direita = "Don't go to the RIGHT!",
  89.     numero = "Type this number: ",
  90.     digitar = "Type anything and send to me.",
  91.     abaixar = "Turn down!",
  92.     falar = "Don't speak nothing!",
  93.     pular = "Don't jump!",
  94.     mexer = "Don't move!",
  95.     bandeira = "Balance the flag of anything country!",
  96.     ano = "What year are we?",
  97.     vesquerda = "Stay facing LEFT!",
  98.     vdireita = "Stay facing RIGHT!",
  99.     quadrado = "Stay on the white square!",
  100.     retangulo = "Stay on the white rectangle!",
  101.     nretangulo = "Don't stay on the white rectangle!",
  102.     preesquerda30 = "Press 30 times the LEFT key!",
  103.     predireita30 = "Press 30 times the RIGHT key!",
  104.     preesquerda60 = "Press 60 times the LEFT key!",
  105.     predireita60 = "Press 60 times the RIGHT key!",
  106.     espaco = "Press 20 times the SPACEBAR!",
  107.     nome = "Type your nickname (with #number)!",
  108.     abracar = "Hug someone!",
  109.     beijar = "Kiss someone!",
  110.     ndance = "Don't dance!",
  111.     mestre = "Master Says",
  112.     map = "Map",
  113.     time = "Time",
  114.     mice = "Mice",
  115.     round = "Round",
  116.     mices = "This room requires at least 4 players.",
  117.     difficulty = "Difficulty",
  118.     creator = "Module created by Jessiewind26#2546",
  119.     segundos = "seconds.",
  120.     fim = "End of match! The next match will start on "
  121. }
  122.  
  123. --[[ Fim das traduções. ]]--
  124.  
  125. if tfm.get.room.community == "br" then
  126.     text = lang.br
  127. else
  128.     text = lang.en
  129. end
  130. function eventNewPlayer(name)
  131.     rato=rato+1
  132.     for k=32, 87 do
  133.         tfm.exec.bindKeyboard(name,k,true,true)
  134.     end
  135.     system.bindMouse(name,true)
  136.     newData={
  137.             ["c"]=0;
  138.             ["s"]=0;
  139.             };     
  140.     data[name] = newData;
  141.     tfm.exec.chatMessage(""..text.welcome.."",name)
  142. end
  143. for name,player in pairs(tfm.get.room.playerList) do
  144.     eventNewPlayer(name)
  145. end
  146. function eventPlayerDied(name)
  147.     if active >= 0 then
  148.         vivo=vivo-1
  149.         local i=0
  150.         local name
  151.         for pname,player in pairs(tfm.get.room.playerList) do
  152.             if not player.isDead then
  153.                 i=i+1
  154.                 name=pname
  155.             end
  156.         end
  157.         if i==0 then
  158.             active=-1
  159.         elseif i==1 then
  160.             active=-1
  161.             tfm.exec.giveCheese(name)
  162.             tfm.exec.playerVictory(name)
  163.             tfm.exec.setGameTime(10)
  164.         end
  165.     end
  166. end
  167. function eventNewGame()
  168.     ui.removeTextArea(0,nil)
  169.     rodada=0
  170.     active=0
  171.     vivo=0
  172.     rato=0
  173.     dificuldade=1
  174.     if unlocked == true then
  175.         tfm.exec.setGameTime(24)
  176.     else
  177.         tfm.exec.setGameTime(36000)
  178.     end
  179.     for name,player in pairs(tfm.get.room.playerList) do
  180.         vivo=vivo+1
  181.         rato=rato+1
  182.         data[name].c=0
  183.     end
  184.     rodadas=math.floor(10+(rato/2))
  185. end
  186. function eventPlayerLeft()
  187.     rato=rato-1
  188. end
  189. function sortearComandos()
  190.     active=math.random(1,35) -- Importante: Altere o segundo número conforme a quantidade de comandos presentes no script.
  191.     getCommand()
  192. end
  193. function eventChatCommand(name,message)
  194.     if message == "help" then
  195.         tfm.exec.chatMessage(""..text.welcome.."",name)
  196.     end
  197.    
  198.     --[[ Comando usado para testar mapas das pessoas. ]]--
  199.  
  200.     if name == "Jessiewind26#2546" then
  201.         if(message:sub(0,5) == "rodar") then
  202.                 tfm.exec.newGame(message:sub(7))
  203.         end
  204.     end
  205.  
  206.     --[[ Comando usado para rodar algum comando manualmente. ]]--
  207.  
  208.     if name == "Jessiewind26#2546" then
  209.         if(message:sub(0,7) == "command") then
  210.                 active=tonumber(message:sub(9))
  211.                 getCommand()
  212.         end
  213.     end
  214.  
  215.     --[[ Comandos para fins particulares e que podem ser removidos. ]]--
  216.  
  217.     if name == "Jessiewind26#2546" then
  218.         if(message:sub(0,3) == "msg") then
  219.             if active >= 0 then
  220.                 tfm.exec.chatMessage("<VP>• <b>[Jesse Glenn] </b> "..message:sub(5).."",nil)
  221.             end
  222.         end
  223.     end
  224. end
  225. function getCommand()
  226.     rodada=rodada+1
  227.     for name,player in pairs(tfm.get.room.playerList) do
  228.         data[name].c=0
  229.         data[name].s=0
  230.     end
  231.  
  232.     --[[ Aqui vai os números dos comandos, o tempo para executá-los e a variável com o texto a ser exibido. ]]--
  233.  
  234.     if active == 1 then
  235.         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)
  236.         tfm.exec.setGameTime(5)
  237.     end
  238.     if active == 2 then
  239.         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)
  240.         tfm.exec.setGameTime(5)
  241.     end
  242.     if active == 3 then
  243.         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)
  244.         tfm.exec.setGameTime(6)
  245.     end
  246.     if active == 4 then
  247.         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)
  248.         tfm.exec.setGameTime(6)
  249.     end
  250.     if active == 5 then
  251.         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)
  252.         tfm.exec.setGameTime(15)
  253.     end
  254.     if active == 6 then
  255.         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)
  256.         tfm.exec.setGameTime(8)
  257.     end
  258.     if active == 7 then
  259.         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)
  260.         tfm.exec.setGameTime(5)
  261.     end
  262.     if active == 8 then
  263.         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)
  264.         tfm.exec.setGameTime(5)
  265.     end
  266.     if active == 9 then
  267.         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)
  268.         tfm.exec.setGameTime(5)
  269.     end
  270.     if active == 10 then
  271.         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)
  272.         tfm.exec.setGameTime(8)
  273.         for name,player in pairs(tfm.get.room.playerList) do
  274.             data[name].c=1 -- isto indica que todos permanecerão vivos
  275.         end
  276.     end
  277.     if active == 11 then
  278.         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)
  279.         tfm.exec.setGameTime(8)
  280.         for name,player in pairs(tfm.get.room.playerList) do
  281.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  282.         end
  283.     end
  284.     if active == 12 then
  285.         number=math.random(100000000,999999999)
  286.         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)
  287.         tfm.exec.setGameTime(12)
  288.     end
  289.     if active == 13 then
  290.         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)
  291.         tfm.exec.setGameTime(7)
  292.     end
  293.     if active == 14 then
  294.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.abaixar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  295.         tfm.exec.setGameTime(5)
  296.     end
  297.     if active == 15 then
  298.         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)
  299.         tfm.exec.setGameTime(5)
  300.         for name,player in pairs(tfm.get.room.playerList) do
  301.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  302.         end
  303.     end
  304.     if active == 16 then
  305.         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)
  306.         tfm.exec.setGameTime(5)
  307.         for name,player in pairs(tfm.get.room.playerList) do
  308.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  309.         end
  310.     end
  311.     if active == 17 then
  312.         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)
  313.         tfm.exec.setGameTime(5)
  314.         for name,player in pairs(tfm.get.room.playerList) do
  315.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  316.         end
  317.     end
  318.     if active == 18 then
  319.         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)
  320.         tfm.exec.setGameTime(8)
  321.     end
  322.     if active == 19 then
  323.         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)
  324.         tfm.exec.setGameTime(5)
  325.     end
  326.     if active == 20 then
  327.         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)
  328.         tfm.exec.setGameTime(5)
  329.         for name,player in pairs(tfm.get.room.playerList) do
  330.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  331.         end
  332.     end
  333.     if active == 21 then
  334.         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)
  335.         tfm.exec.setGameTime(5)
  336.         for name,player in pairs(tfm.get.room.playerList) do
  337.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  338.         end
  339.     end
  340.     if active == 22 then
  341.         xpos=math.random(60,650) -- calcula aleatoriamente a posição do quadrado branco
  342.         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)
  343.         tfm.exec.setGameTime(5)
  344.         for name,player in pairs(tfm.get.room.playerList) do
  345.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  346.         end
  347.         ui.addTextArea(1,"",nil,xpos,320,80,65,0xffffff,0xffffff,0.68,false)
  348.     end
  349.     if active == 23 then
  350.         xpos=math.random(60,650) -- calcula aleatoriamente a posição do retângulo branco
  351.         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)
  352.         tfm.exec.setGameTime(5)
  353.         for name,player in pairs(tfm.get.room.playerList) do
  354.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  355.         end
  356.         ui.addTextArea(1,"",nil,xpos,0,80,400,0xffffff,0xffffff,0.68,false)
  357.     end
  358.     if active == 24 then
  359.         xpos=math.random(60,650) -- calcula aleatoriamente a posição do retângulo branco
  360.         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)
  361.         tfm.exec.setGameTime(5)
  362.         for name,player in pairs(tfm.get.room.playerList) do
  363.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  364.         end
  365.         ui.addTextArea(1,"",nil,xpos,0,80,400,0xffffff,0xffffff,0.68,false)
  366.     end
  367.     if active == 25 then
  368.         ypos=math.random(40,300) -- calcula aleatoriamente a posição do retângulo branco
  369.         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)
  370.         tfm.exec.setGameTime(7)
  371.         for name,player in pairs(tfm.get.room.playerList) do
  372.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  373.         end
  374.         ui.addTextArea(1,"",nil,0,ypos,1600,60,0xffffff,0xffffff,0.68,false)
  375.     end
  376.     if active == 26 then
  377.         ypos=math.random(40,300) -- calcula aleatoriamente a posição do retângulo branco
  378.         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)
  379.         tfm.exec.setGameTime(7)
  380.         for name,player in pairs(tfm.get.room.playerList) do
  381.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  382.         end
  383.         ui.addTextArea(1,"",nil,0,ypos,1600,60,0xffffff,0xffffff,0.68,false)
  384.     end
  385.     if active == 27 then
  386.         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)
  387.         tfm.exec.setGameTime(9)
  388.     end
  389.     if active == 28 then
  390.         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)
  391.         tfm.exec.setGameTime(9)
  392.     end
  393.     if active == 29 then
  394.         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)
  395.         tfm.exec.setGameTime(15)
  396.     end
  397.     if active == 30 then
  398.         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)
  399.         tfm.exec.setGameTime(15)
  400.     end
  401.     if active == 31 then
  402.         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)
  403.         tfm.exec.setGameTime(7)
  404.     end
  405.     if active == 32 then
  406.         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)
  407.         tfm.exec.setGameTime(12)
  408.     end
  409.     if active == 33 then
  410.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.abracar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  411.         tfm.exec.setGameTime(12)
  412.     end
  413.     if active == 34 then
  414.         ui.addTextArea(0,"<font face='Segoe UI'><font color='#29CC06'><font size='25'><p align='center'>"..text.beijar.."",nil,25,20,750,40,0x0C2301,0x5DD872,0.96,true)
  415.         tfm.exec.setGameTime(12)
  416.     end
  417.     if active == 35 then
  418.         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)
  419.         tfm.exec.setGameTime(6)
  420.         for name,player in pairs(tfm.get.room.playerList) do
  421.             data[name].c=1 -- isto indica que todos permanecerão vivos, a menos que descumpram o comando
  422.         end
  423.     end
  424.  
  425.     --[[ Fim da descrição dos comandos. ]]--
  426.  
  427. end
  428.  
  429. --[[ Operações com ações (dança, sentar...)
  430. Utilize data[name].c=1 para informar ao código que o comando foi executado.
  431. 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. ]]--
  432.  
  433. function eventChatMessage(name,message)
  434.     if active == 12 then
  435.         if message == tostring(number) then
  436.             data[name].c=1
  437.         end
  438.     end
  439.     if active == 13 then
  440.         data[name].c=1
  441.     end
  442.     if active == 15 then
  443.         tfm.exec.killPlayer(name)
  444.     end
  445.     if active == 19 then
  446.         if message == "2018" then
  447.             data[name].c=1
  448.         end
  449.     end
  450.     if active == 32 then
  451.         if string.upper(message) == string.upper(name) then
  452.             data[name].c=1
  453.         end
  454.     end
  455. end
  456. function eventEmotePlayed(name,id)
  457.     if active == 1 then
  458.         if id == 0 then
  459.             data[name].c=1
  460.         end
  461.     end
  462.     if active == 2 then
  463.         if id == 8 then
  464.             data[name].c=1
  465.         end
  466.     end
  467.     if active == 3 then
  468.         if id == 9 then
  469.             data[name].s=data[name].s+1
  470.             if data[name].s >= 5 then
  471.                 data[name].c=1
  472.             end
  473.         end
  474.     end
  475.     if active == 5 then
  476.         if id == 3 then
  477.             data[name].s=data[name].s+1
  478.             if data[name].s >= 10 then
  479.                 data[name].c=1
  480.             end
  481.         end
  482.     end
  483.     if active == 6 then
  484.         if id == 5 then
  485.             data[name].s=data[name].s+1
  486.             if data[name].s >= 5 then
  487.                 data[name].c=1
  488.             end
  489.         end
  490.     end
  491.     if active == 7 then
  492.         if id == 6 then
  493.             data[name].c=1
  494.         end
  495.     end
  496.     if active == 8 then
  497.         if id == 4 then
  498.             data[name].c=1
  499.         end
  500.     end
  501.     if active == 9 then
  502.         if id == 2 then
  503.             data[name].c=1
  504.         end
  505.     end
  506.     if active == 17 then
  507.         tfm.exec.killPlayer(name)
  508.     end
  509.     if active == 18 then
  510.         if id == 10 then
  511.             data[name].c=1
  512.         end
  513.     end
  514.     if active == 33 then
  515.         if id == 17 or id == 18 then
  516.             data[name].c=1
  517.         end
  518.     end
  519.     if active == 34 then
  520.         if id == 21 or id == 22 then
  521.             data[name].c=1
  522.         end
  523.     end
  524.     if active == 35 then
  525.         if id == 0 then
  526.             tfm.exec.killPlayer(name)
  527.         end
  528.     end
  529. end
  530. function eventMouse(name,x,y)
  531.     if active == 4 then
  532.         data[name].s=data[name].s+1
  533.         if data[name].s >= 10 then
  534.             data[name].c=1
  535.         end
  536.     end
  537. end
  538. function eventKeyboard(name,id,down,x,y)
  539.     if active == 10 then
  540.         if id == 37 or id == 65 then
  541.             tfm.exec.killPlayer(name)
  542.         end
  543.     end
  544.     if active == 11 then
  545.         if id == 39 or id == 68 then
  546.             tfm.exec.killPlayer(name)
  547.         end
  548.     end
  549.     if active == 14 then
  550.         if id == 40 or id == 83 then
  551.             data[name].c=1
  552.         end
  553.     end
  554.     if active == 16 then
  555.         if id == 38 or id == 87 then
  556.             tfm.exec.killPlayer(name)
  557.         end
  558.     end
  559.     if active == 17 then
  560.         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
  561.             tfm.exec.killPlayer(name)
  562.         end
  563.     end
  564.     if active == 27 then
  565.         if id == 37 or id == 65 then
  566.             data[name].s=data[name].s+1
  567.             if data[name].s >= 30 then
  568.                 data[name].c=1
  569.             end
  570.         end
  571.     end
  572.     if active == 28 then
  573.         if id == 39 or id == 68 then
  574.             data[name].s=data[name].s+1
  575.             if data[name].s >= 30 then
  576.                 data[name].c=1
  577.             end
  578.         end
  579.     end
  580.     if active == 29 then
  581.         if id == 37 or id == 65 then
  582.             data[name].s=data[name].s+1
  583.             if data[name].s >= 60 then
  584.                 data[name].c=1
  585.             end
  586.         end
  587.     end
  588.     if active == 30 then
  589.         if id == 39 or id == 68 then
  590.             data[name].s=data[name].s+1
  591.             if data[name].s >= 60 then
  592.                 data[name].c=1
  593.             end
  594.         end
  595.     end
  596.     if active == 31 then
  597.         if id == 32 then
  598.             data[name].s=data[name].s+1
  599.             if data[name].s >= 15 then
  600.                 data[name].c=1
  601.             end
  602.         end
  603.     end
  604. end
  605.  
  606. --[[ Fim das operações com ações. ]]--
  607.  
  608. function eventLoop(passado,faltando)
  609.     local tempo=math.floor(faltando/1000)
  610.     if active == -2 then
  611.         ui.setMapName("<N>"..text.mices.."<")
  612.     elseif active == -1 then
  613.         ui.setMapName("<VP>"..text.fim.."<b>"..tempo.."</b> "..text.segundos.."<")
  614.     else
  615.         ui.setMapName(""..text.mestre.."   <G>|   <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.."<")
  616.     end
  617.     if active >= 0 then
  618.         if passado > 1200 and passado < 1700 and unlocked == true then
  619.             tfm.exec.chatMessage("Playing map <J>"..tfm.get.room.currentMap.."<BL> created by <J>"..tfm.get.room.xmlMapInfo.author)
  620.         end
  621.     end
  622.  
  623.     --[[ Código que verifica se há pelo menos 4 ratos na sala. ]]--
  624.  
  625.     if rato < 4 then
  626.         if tfm.get.room.currentMap == "@7277839" and unlocked == true then
  627.             active=-2
  628.             tfm.exec.setGameTime(8000)
  629.         else
  630.             if passado > 3000 and unlocked == true then
  631.                 tfm.exec.newGame("@7277839")
  632.                 tfm.exec.setGameTime(8000)
  633.                 tfm.exec.chatMessage("<R>"..text.mices.."",nil)
  634.             end
  635.         end
  636.     end
  637.     if rato >= 4 then
  638.         if tfm.get.room.currentMap == "@7277839" and unlocked == true then
  639.             tfm.exec.newGame(mapas[math.random(#mapas)])
  640.             active=0
  641.         end
  642.     end
  643.  
  644.     if active < 0 and faltando < 1 and unlocked == true then
  645.         tfm.exec.newGame(mapas[math.random(#mapas)])
  646.     end
  647.     if active == 0 and faltando < 1000 then
  648.         if rodada < rodadas then
  649.             sortearComandos()
  650.         else
  651.             active=-1
  652.             tfm.exec.setGameTime(10)
  653.             for name,player in pairs(tfm.get.room.playerList) do
  654.                 tfm.exec.giveCheese(true)
  655.                 tfm.exec.playerVictory(true)
  656.             end
  657.         end
  658.     end
  659.     if active > 0 and faltando < 1 and rato > 1 then
  660.  
  661.         --[[ Código necessário para a execução dos comandos 20 e 21. ]]--
  662.  
  663.         if active == 20 then
  664.             for name,player in pairs(tfm.get.room.playerList) do
  665.                 if tfm.get.room.playerList[name].isFacingRight == true then
  666.                     tfm.exec.killPlayer(name)
  667.                 end
  668.             end
  669.         end
  670.         if active == 21 then
  671.             for name,player in pairs(tfm.get.room.playerList) do
  672.                 if tfm.get.room.playerList[name].isFacingRight == false then
  673.                     tfm.exec.killPlayer(name)
  674.                 end
  675.             end
  676.         end
  677.  
  678.         --[[ Código necessário para a execução do comando 22. Margens de erro incluídas. ]]--
  679.  
  680.         if active == 22 then
  681.             for name,player in pairs(tfm.get.room.playerList) do
  682.                 if player.y < 300 then
  683.                     tfm.exec.killPlayer(name)
  684.                 else
  685.                     if player.x < xpos-20 or player.x > xpos+100 then
  686.                         tfm.exec.killPlayer(name)
  687.                     end
  688.                 end
  689.             end
  690.         end
  691.  
  692.         --[[ Código necessário para a execução do comando 23. ]]--
  693.  
  694.         if active == 23 then
  695.             for name,player in pairs(tfm.get.room.playerList) do
  696.                 if player.x < xpos or player.x > xpos+80 then
  697.                     tfm.exec.killPlayer(name)
  698.                 end
  699.             end
  700.         end
  701.  
  702.         --[[ Código necessário para a execução do comando 24. ]]--
  703.  
  704.         if active == 24 then
  705.             for name,player in pairs(tfm.get.room.playerList) do
  706.                 if player.x > xpos and player.x < xpos+80 then
  707.                     tfm.exec.killPlayer(name)
  708.                 end
  709.             end
  710.         end
  711.  
  712.         --[[ Código necessário para a execução do comando 25. Margens de erro incluídas. ]]--
  713.  
  714.         if active == 25 then
  715.             for name,player in pairs(tfm.get.room.playerList) do
  716.                 if player.y < ypos-10 or player.y > ypos+70 then
  717.                     tfm.exec.killPlayer(name)
  718.                 end
  719.             end
  720.         end
  721.  
  722.         --[[ Código necessário para a execução do comando 26. Margens de erro incluídas. ]]--
  723.  
  724.         if active == 26 then
  725.             for name,player in pairs(tfm.get.room.playerList) do
  726.                 if player.y > ypos-10 and player.y < ypos+70 then
  727.                     tfm.exec.killPlayer(name)
  728.                 end
  729.             end
  730.         end
  731.  
  732.         ui.removeTextArea(0,nil)
  733.         ui.removeTextArea(1,nil)
  734.         active=0
  735.         if rodada == 10 or rodada == 15 or rodada == 20 or rodada == 25 then
  736.             dificuldade=dificuldade+1
  737.         end
  738.         for name,player in pairs(tfm.get.room.playerList) do
  739.             if data[name].c == 0 then
  740.                 tfm.exec.killPlayer(name)
  741.             end
  742.         end
  743.         if vivo > 2 then
  744.             tfm.exec.setGameTime(7-dificuldade)
  745.         else
  746.             tfm.exec.setGameTime(10-dificuldade)
  747.         end
  748.     end
  749.  
  750.     --[[ Isto faz com que aqueles que cumpram o comando tenham o nome pintado de verde. ]]--
  751.  
  752.     for name,player in pairs(tfm.get.room.playerList) do
  753.         if data[name].c == 1 then
  754.             tfm.exec.setNameColor(name,0x00ff00)
  755.         else
  756.             tfm.exec.setNameColor(name,0xc2c2da)
  757.         end
  758.     end
  759. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement