Advertisement
Haxhhhhhhhhh

True or False RTM 1.123

Aug 29th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.14 KB | None | 0 0
  1. for _,f in next,{"AutoScore","AutoNewGame","AutoTimeLeft","AllShamanSkills","PhysicalConsumables","AfkDeath"} do
  2.     tfm.exec["disable"..f](false)
  3. end
  4. tfm.exec.setRoomMaxPlayers(35)
  5. t=false;
  6. f=false;
  7. tempa=20   
  8. ratos=0
  9. loop=0
  10. temp2=3
  11. resposta="0"
  12. players={}
  13. votos=0
  14. vivo=0;
  15. min1=0
  16. seg1=0
  17. seg2=0
  18. lt=0
  19. segundos=0
  20. lock=false;
  21. pergunta=""
  22. shaman=""
  23. lock=false
  24. minutos=8;
  25. modo="desativado"
  26. for _,f in next,{"admin77","admin78","limite"} do
  27.     system.disableChatCommandDisplay(f)
  28. end
  29. mapa="@7417328"
  30. lang = {}
  31.  
  32. lang.br = {
  33.   textFalse = "A resposta era FALSO!",
  34.   textTrue = "A resposta era VERDADEIRO!",
  35.   textRandom = "Um shaman aleatório foi escolhido.",
  36.   textSkip = "O shaman passou a vez.",
  37.   textPergunta = "Insira a sua pergunta:<br><br>NÃO USE SÍMBOLOS ESPECIAIS NA PERGUNTA!",
  38.   textTime = "Tempo esgotado!",
  39.   textNothingWins = "Ninguém venceu esta partida. :(",
  40.   textWinner = " venceu a partida!",
  41.   textNothing = "Não tivemos vencedor nessa partida.",
  42.   textTimeOut = "O tempo da partida acabou! Outro shaman será escolhido.",
  43.   textTimeLeave = "Tempo esgotado! Outro shaman será escolhido.",
  44.   textTrueFalse = "Envie SIM se a resposta for verdadeira ou NÃO se a resposta for falsa.",
  45.   textEnter = "<b>Bem-vindo ao module True or False!</b><br><BL>Para maiores informações sobre o jogo, digite !help.<br><br><VP>Atualização RTM 1.123:<br>- Correção de pequenos bugs",
  46.   textHelp = "<J>Quando o shaman fizer uma pergunta, você deverá ir no campo TRUE se a resposta for verdadeira ou no campo FALSE se a resposta for falsa. Aqueles que errarem serão eliminados da partida. O processo continua até que sobre um vencedor, que será o novo shaman.<br>Se você for o shaman, digite !per para fazer uma pergunta.<br><br>PERGUNTAS QUE NÃO DEVEM SER FEITAS:<br>- Perguntas envolvendo questões pessoais<br>- Perguntas que envolvam opinião<br>- Perguntas que envolvam racismo, sexo, pornografia e afins<br>- Pegadinhas, mesmo que não sejam intencionais<br>- Perguntas que possam causar tumulto na sala<br>entre outros...<br><br>Caso você veja alguém infringindo as regras, use o comando /ban [usuário] para votar para tirá-lo da sala.<br><br>- Script criado por Forzaldenon#0000<br>- Recursos adicionais criados por Darakdarkus7#0000",
  47.   textGotShaman = "<J>Você é o shaman. Digite <b>!per</b> para fazer uma pergunta.<br>Você tem 1 minuto para fazer sua pergunta, ou outro shaman entrará em seu lugar.<br><br>Digite <b>!skip</b> para pular sua vez de shaman.",
  48.   textLowTime = "O tempo da partida está acabando.",
  49.   mices = "São necessários pelo menos 6 jogadores para jogar True or False",
  50.   textArea1 = "Tempo da partida:",
  51.   textArea2 = "Ratos vivos:",
  52.   textArea3 = "Limite de tempo:",
  53.   textLongQuestion = "Sua pergunta é muito longa. Tente usar uma pergunta menor.",
  54.   textShortQuestion = "Sua pergunta é muito curta ou não é permitida.",
  55.   textCmd = "<VP>Comandos do jogo:<br><br>!per = faz uma pergunta (quando você é shaman)<br>!skip = pula a sua vez (quando você é shaman)",
  56.   textLt = "<J>Use o comando /ban [nome] para reportar alguém que esteja infrigindo as regras da sala.",
  57. }
  58. lang.en = {
  59.   textFalse = "The answer was FALSE!",
  60.   textTrue = "The answer was TRUE!",
  61.   textRandom = "A random shaman has been choosed.",
  62.   textSkip = "The shaman skipped your turn.",
  63.   textPergunta = "Type your question here:",
  64.   textTime = "Time is up!",
  65.   textNothingWins = "Nothing wins the game. :(",
  66.   textWinner = " wons the game!",
  67.   textNothing = "Aren't winners on this game.",
  68.   textTimeOut = "The game time is gone! Other shaman has been choosed.",
  69.   textTimeLeave = "Time is up! Other shaman has been choosed.",
  70.   textTrueFalse = "Send YES if the answer is TRUE or send NO if the answer is FALSE.",
  71.   textEnter = "<b>Welcome to module True or False!</b><br><V>For more information of the game, type !help.<br><br><VP>Update RTM 1.123:<br>- Correction of small bugs",
  72.   textHelp = "<J>When the shaman make the question, You must go to the TRUE side if the answer is true or go to the FALSE side if the answer is false. If you err the answer, you will be eliminated of the game. The process continue until someone win the game, which will be the new shaman.<br>If you are the shaman, type !per to make a question.<br>QUESTIONS DON'T ALLOWED ON GAME:<br>- Questions involving pessoal things<br>- Questions involving opinions<br>- Questions involving racism, pornography, sexual things...<br>- 'Troll' questions, included questions that aren't intencional<br>and many more...<br><br>If you see someone breaking the rules, use the /ban [user] command to vote to get him out of the room.<br><br>Suggestions and problems report to Forzaldenon#0000.",
  73.   textGotShaman = "<J>You are the shaman. Type <b>!per</b> to make a question.<br>You have 1 minute to make the question, or other shaman will enter in your place.<br><br>Type <b>!skip</b> to skip your shaman turn.",
  74.   textLowTime = "The match time is ending.",
  75.   mices = "Are needed at least 6 players to play True or False.",
  76.   textArea1 = "Match time:",
  77.   textArea2 = "Mices alive:",
  78.   textArea3 = "Time limit:",
  79.   textLongQuestion = "Your question is very long. Try to use a short question.",
  80.   textShortQuestion = "Your question is very short or isn't allowed.",
  81.   textCmd = "<VP>Game commands:<br><br>!per = make a question (only for shaman)<br>!skip = skip your shaman turn (only for shaman)",
  82.   textLt = ""
  83. }
  84. if tfm.get.room.community == "br" then
  85.     text = lang.br
  86. else
  87.     text = lang.en
  88. end
  89. function obterJogadores()
  90.     players={}
  91.     for name,player in pairs(tfm.get.room.playerList) do
  92.     if not tfm.get.room.playerList[name].isDead then
  93.         table.insert(players,name)
  94.     end
  95.     end
  96. end
  97. function eventNewPlayer(name)
  98.     ratos=ratos+1;
  99.     tfm.exec.chatMessage("<J>"..text.textEnter.."",name)
  100.     obterJogadores()
  101. end
  102. for name,player in pairs(tfm.get.room.playerList) do
  103.     tfm.exec.setPlayerScore(name,0,false)
  104.     eventNewPlayer(name)
  105. end
  106. function eventPlayerLeft(name)
  107.     ratos=ratos-1;
  108.     obterJogadores()
  109. end
  110. function eventChatCommand(name,message)
  111.     if tfm.get.room.currentMap == "@7417328" then
  112.     if message == "f5" then
  113.         if name == "Forzaldenon#0000" then
  114.             t=true;
  115.             tfm.exec.chatMessage("<R>"..text.textFalse.."",nil)
  116.             modo="desativado" end
  117.     elseif message == "skip" then
  118.             if tfm.get.room.playerList[name].isShaman then
  119.             obterJogadores()
  120.             tfm.exec.chatMessage("<R>"..text.textSkip.."",nil)
  121.             eventChatCommand("Forzaldenon#0000","admin77") end         
  122.     elseif message == "v5" then
  123.         if name == "Forzaldenon#0000" then
  124.             f=true;
  125.             tfm.exec.chatMessage("<VP>"..text.textTrue.."",nil)
  126.             modo="desativado" end
  127.     elseif message == "per" then
  128.         if tfm.get.room.playerList[name].isShaman then
  129.             if modo == "desativado" then
  130.                 ui.removeTextArea(27,nil)
  131.                 ui.addPopup(1,2,""..text.textPergunta.."",name,250,125,350,true)
  132.             end
  133.         end
  134.     elseif message == "admin77" then
  135.         if modo == "desativado" then
  136.         if name == "Forzaldenon#0000" or name == "Ashearcher#0000" then
  137.             changeMap()
  138.             tfm.exec.setShaman(message:sub(50))
  139.         end end
  140.     elseif(message:sub(1,7) == "admin78") then
  141.         if modo == "desativado" then
  142.         if name == "Forzaldenon#0000" or name == "Ashearcher#0000" then
  143.             tfm.exec.setPlayerScore(message:sub(9),8001,false)
  144.             changeMap()
  145.         end end
  146.     elseif(message:sub(0,4) == "kill") then
  147.         if name == "Forzaldenon#0000" or name == "Ashearcher#0000" then
  148.             tfm.exec.killPlayer(message:sub(6))
  149.         end
  150.     elseif message == "help" then
  151.         tfm.exec.chatMessage("<N>"..text.textHelp.."",name)
  152.     elseif message == "cmd" then
  153.         tfm.exec.chatMessage("<N>"..text.textCmd.."",name)
  154.     end
  155.     end
  156. end
  157. function eventNewGame()
  158.     ui.removeTextArea(27,nil)
  159.     tfm.exec.setGameTime(63)
  160.     vivo=0;
  161.     modo="desativado"
  162.     tempa=19
  163.     votos=0;
  164.     t=false;
  165.     f=false;
  166.     segundos=0;
  167.     min1=0
  168.     min3=0
  169.     seg1=0
  170.     seg2=0
  171.     for name,player in pairs(tfm.get.room.playerList) do
  172.         if name:sub(1,1) == "*" then
  173.             tfm.exec.killPlayer(name)
  174.                 tfm.exec.chatMessage("<R>Souris aren't allowed to play on this module. Create an account or log in to play True or False.",name)
  175.         end
  176.         vivo=vivo+1
  177.         if tfm.get.room.playerList[name].isShaman then
  178.             tfm.exec.setPlayerScore(name,-2,false)
  179.             vivo=vivo-1
  180.         end
  181.     end
  182.     obterJogadores()
  183. end
  184. function eventLoop(pass,tempo)
  185.     local pass2=tempo/1000
  186.     lt=lt+1
  187.     if lt >= 1200 then
  188.         if tfm.get.room.community == "br" then
  189.             tfm.exec.chatMessage("<R>"..text.textLt.."",nil)
  190.             lt=0
  191.         end
  192.     end
  193.     if tfm.get.room.currentMap == "@7277839" then
  194.         tfm.exec.setGameTime(63)
  195.     end
  196.     if lock == true then
  197.         tfm.exec.setGameTime(tempo/950)
  198.     end
  199.     loop=loop+0.5
  200.     if pass >= 3000 and pass <= 179995 then
  201.         if ratos < 6 then
  202.             if tfm.get.room.currentMap == "@7417328" then
  203.                 tfm.exec.newGame("@7277839")
  204.                 tfm.exec.chatMessage("<R>"..text.mices.."",nil)
  205.             end
  206.         end
  207.     end
  208.     if ratos >= 6 then
  209.         if tfm.get.room.currentMap == "@7277839" then
  210.             changeMap()
  211.         end
  212.     end
  213.     if min1 == minutos-1 then
  214.         ui.addTextArea(125,"<font size='13'><font color='#ff0000'>   <font face='Segoe UI'>"..text.textArea1.." <b>"..min1..":"..seg1..""..seg2.."</b>                                                 "..text.textArea2.." <b>"..vivo.."</b>                                            "..text.textArea3.." <b>"..minutos.." min.</b>",nil,5,380,790,22,0,0,1.0,true)
  215.     else
  216.         ui.addTextArea(125,"<font size='13'><font color='#010101'>   <font face='Segoe UI'>"..text.textArea1.." <b>"..min1..":"..seg1..""..seg2.."</b>                                                 "..text.textArea2.." <b>"..vivo.."</b>                                            "..text.textArea3.." <b>"..minutos.." min.</b>",nil,5,380,790,22,0,0,1.0,true)
  217.     end
  218.     if loop == 1 then
  219.         segundos=segundos+1
  220.         seg2=seg2+1
  221.         loop=0
  222.     if seg2 >= 10 then
  223.         seg2=0
  224.         seg1=seg1+1
  225.         if seg1 >= 6 then
  226.             min1=min1+1
  227.             seg1=0
  228.             seg2=0
  229.             end
  230.             if min1 >= minutos then
  231.                 for name,player in pairs(tfm.get.room.playerList) do
  232.                     if tfm.get.room.playerList[name].isShaman then
  233.                         ui.addPopup(1,0,""..text.textTime.."",name,350,175,200,true)
  234.                         ui.addPopup(2,0,""..text.textTime.."",name,350,175,200,true)
  235.                     end
  236.                 end
  237.                 tfm.exec.chatMessage("<R>"..text.textTimeOut.."",nil)
  238.                 eventChatCommand("Forzaldenon#0000","admin77")
  239.             end
  240.         end
  241.     end
  242.     tfm.exec.setUIMapName("True or False - RTM 1.123")
  243.     if modo == "pergunta" then
  244.         tempa=tempa-0.5
  245.     end
  246.     for name,player in pairs(tfm.get.room.playerList) do
  247.         if tfm.get.room.playerList[name].isShaman then
  248.        if tfm.get.room.currentMap == "@7417328" then
  249.             if pass > 450 and pass < 1050 then
  250.                 tfm.exec.chatMessage("<VP>"..text.textGotShaman.."",name)
  251.         tfm.exec.setPlayerScore(name,-2,false)
  252.          end
  253.             end
  254.         end
  255.     end
  256.     if tempa < 0.1 then
  257.         modo="resposta"
  258.         tempa=0
  259.         for pn, p in pairs(tfm.get.room.playerList) do
  260.             if p.y <= 220 then
  261.                 tfm.exec.killPlayer(pn)
  262.             end
  263.         end
  264.     end
  265.     if f == true then
  266.         for pn, p in pairs(tfm.get.room.playerList) do
  267.             if p.x >= 405 then
  268.                 tfm.exec.killPlayer(pn)
  269.                 modo="desativado"
  270.             end
  271.         end
  272.         f=false;
  273.     end
  274.     if t == true then
  275.         for pn, p in pairs(tfm.get.room.playerList) do
  276.             if p.x <= 395 then
  277.                 tfm.exec.killPlayer(pn)
  278.                 modo="desativado"
  279.             end
  280.         end
  281.         t=false;
  282.     end
  283.     if modo == "resposta" then
  284.         tfm.exec.setGameTime(63)
  285.         temp2=temp2-0.5
  286.         if temp2 == 1 then
  287.             modo="desativado"
  288.             if resposta == "yes" then
  289.                 eventChatCommand("Forzaldenon#0000","v5")
  290.             else
  291.                 eventChatCommand("Forzaldenon#0000","f5")
  292.             end
  293.             tempa=19
  294.             temp2=3
  295.             pergunta=""
  296.             ui.removeTextArea(27,nil)
  297.         end
  298.     end
  299.     if modo == "desativado" then
  300.     if tempo < 60000 and tempo > 59400 then
  301.         if pass > 10000 then
  302.             for name,player in pairs(tfm.get.room.playerList) do
  303.             if not tfm.get.room.playerList[name].isDead then
  304.                 tfm.exec.setPlayerScore(name,1,true)
  305.             end
  306.         end
  307.         end
  308.     end
  309.     if tfm.get.room.currentMap == "@7417328" then
  310.     if vivo == 1 then
  311.         if tempo < 59000 then
  312.             tfm.exec.setPlayerScore(shaman,8000,false)
  313.             changeMap()
  314.         end
  315.     end
  316.     if vivo <= 0 then
  317.         tfm.exec.setGameTime(5)
  318.         obterJogadores()
  319.         changeMap()
  320.         tfm.exec.chatMessage("<R>"..text.textNothing.."",nil)
  321.     end
  322.     if tempo < 500 then
  323.         tfm.exec.setPlayerScore(players[math.random(#players)],1,true)
  324.         for name,player in pairs(tfm.get.room.playerList) do
  325.             if tfm.get.room.playerList[name].isShaman then
  326.                 ui.addPopup(1,0,""..text.textTime.."",name,350,175,200,true)
  327.                 ui.addPopup(2,0,""..text.textTime.."",name,350,175,200,true)
  328.             end
  329.         end
  330.         tfm.exec.chatMessage("<R>"..text.textTimeLeave.."",nil)
  331.         changeMap()
  332.     end
  333.     end
  334.     end
  335.     if modo == "troca" then
  336.         obterJogadores()
  337.         if tempo < 100 then
  338.             changeMap()
  339.         end
  340.     end
  341.     if vivo == 0 then
  342.         shaman=""
  343.     end
  344. end
  345. function eventPopupAnswer(id,name,answer)
  346.     if id == 1 then
  347.         if tfm.get.room.playerList[name].isShaman then
  348.             if tfm.get.room.currentMap == "@7417328" then
  349.                 if string.len(answer) >= 174 then
  350.                     tfm.exec.chatMessage(""..text.textLongQuestion.."",name)
  351.                 elseif string.len(answer) <= 5 then
  352.                     tfm.exec.chatMessage(""..text.textShortQuestion.."",name)
  353.                 else
  354.                     pergunta=answer
  355.                     pcall(ui.addPopup(2,1,""..text.textTrueFalse.."",name,350,175,200,true))
  356.                 end
  357.             end
  358.         end
  359.     end
  360.     if id == 2 then
  361.         resposta=tostring(answer)
  362.         modo="pergunta"
  363.         ui.addTextArea(27,"<font size='15'><font face='Segoe UI'><p align='center'><font color='#020202'>"..pergunta.."",nil,32,338,720,50,0,0,1.0,true)
  364.         tfm.exec.chatMessage("<CH>"..pergunta.."",nil)
  365.         tfm.exec.chatMessage("<BL>"..answer.."","Forzaldenon#0000")
  366.         tfm.exec.setGameTime(20)
  367.         for name,player in pairs(tfm.get.room.playerList) do
  368.             tfm.exec.movePlayer(name,400,102,false,1,1,false)
  369.             if tfm.get.room.playerList[name].isShaman then
  370.                 tfm.exec.movePlayer(name,400,885,false,1,1,false)
  371.             end
  372.         end
  373.     end
  374. end
  375. function eventPlayerDied(name)
  376.     if not tfm.get.room.playerList[name].isShaman then
  377.         vivo=vivo-1
  378.     end
  379.     local i=0
  380.     local n
  381.     for pname,player in pairs(tfm.get.room.playerList) do
  382.         if not player.isDead and not player.isShaman then
  383.             i=i+1
  384.             n=pname
  385.         end
  386.     end
  387.     if i==0 then
  388.         -- não faça nada
  389.     elseif i==1 then
  390.         shaman=n;
  391.     end
  392. end
  393. function changeMap()
  394.     tfm.exec.newGame(mapa)
  395. end
  396. changeMap()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement