Mousetat

Truth or dare private

Jan 20th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.22 KB | None | 0 0
  1. admin="Mousetat"
  2.  
  3.  
  4.  
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAfkDeath(true)
  7. tfm.exec.disableAutoShaman(true)
  8. tfm.exec.disableAutoScore(true)
  9. tfm.exec.newGame("@6411544")
  10.  
  11. players={}--respawn place is 400,320
  12. p={}
  13. timestamp=os.time()
  14. numplayers=0
  15.  
  16. begin=false
  17. answerer="lol"
  18. questioner="lol"
  19. question="lol"
  20. ans="lol"
  21. new=false
  22. restart=false
  23. choose=false
  24. start=true
  25. choosey=false
  26. skip=false
  27. message=""
  28. others={}
  29. summonobject=false
  30. timestamplol={}
  31. answererold=""
  32. one=false
  33. imageID=0
  34.  
  35. truth={}--you can follow the format 'truth[number]="question"'
  36. truth[1]="Who is your crush in this game?"
  37. truth[2]="What is your favourite food?"
  38. truth[3]="Who is you model/favourite person in game?"
  39. truth[4]="What games do you play besides Transformice?"
  40. truth[5]="What would you like to be when you grow up?"
  41. truth[6]="Have you sucked your thumb before?"
  42. truth[7]="What brand of phone do you have currently?"
  43. truth[8]="Have you ever farted in front of your friends or teachers in real life?"
  44. truth[9]="If you could hack transformice, what would you do?"
  45. truth[10]="What is your favourite fur in Transformice if you have to choose?"
  46. truth[11]="Why do you like Transformice?"
  47. truth[12]="What do you dislike/hate most about yourself, whether in personality or physically?"
  48. truth[13]="What do you love most about yourself, whether in personality or physically?"
  49. truth[14]="Tell us whether you love yourself more or hate/dislike yourself more, and tell us why."
  50. truth[15]="Why do you like your current crush in real life, in personality terms AND physical terms?"
  51. truth[16]="Tell us why you hate the person you currently hate in real life, in personality terms."
  52.  
  53.  
  54. dare={}--you can follow the format 'dare[number]="Dare"'
  55. dare[1]="I dare you go into EN/EN2 room 2 and spam this message 10 times: I AM A GUMMY BEAR!I AM A GUMMY BEAR!I AM A GUMMY BEAR!"
  56. dare[2]="I dare you whisper a moderator a swear word."
  57. dare[3]="I dare you tell your crush, or anybody in this room that you love him/her right now"
  58. dare[4]="I dare you go into EN/EN2 room 1 and spam this message 10 times: I'M FLOODING REPORT ME!"
  59. dare[5]="I dare you report a moderator for hacking"
  60. dare[6]="I dare you create an account similar to that of an online moderator and use that account to whisper to the online moderator: Hallo buddy!"
  61. dare[7]="I dare you tell your real life name to everybody in chat"
  62. dare[8]="I dare you take a picture of your real life face and send it to everyone to see."
  63. dare[9]="I dare you go into any #utility room with at least 3 people in it and crash the room."
  64. dare[10]="I dare you give me, the questioner, every ball you have in your inventory, if you have any."
  65. dare[11]="I dare you to disconnect and reconnect right now."
  66. dare[12]="I dare you to say who would be your most likely crush among the players in this room we are in."
  67. dare[13]="I dare you to give all your selfies to me right now, if you have any balls to do it via trade"
  68. dare[14]="I dare you complete this map without cheating!"
  69. dare[15]="I dare you type 'I LOVE YOU (username)' 30 times to a username in room/tribe in room chat or in tribe chat."
  70. dare[16]="I dare you kiss me, the questioner, 20 times :)"
  71. dare[17]="I dare you marry your closest friend, if u are not already married"
  72. dare[18]="I dare you give me, the questioner, every snowball you have in your inventory, if you have any."
  73.  
  74. function eventNewPlayer(name)
  75.     ui.addTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",name,50,365,700,40,0x324650,0x212F36,0.8,true)
  76.     tfm.exec.chatMessage("<font color='#FFFFFF'>Welcome to Truth or Dare!</font> Type <font color='#FF0000'>!help</font> to get help regarding the game rules, and <font color='#FF0000'>!commands</font> to see the list of commands available.",name)
  77.     p[name]={questioners=false, admin=false, spectator=true, ban=false, new=false}
  78. end
  79.  
  80. function eventNewGame()
  81.     tfm.exec.chatMessage("<font color='#FFFFFF'>Welcome to Truth or Dare!</font> Type <font color='#FF0000'>!help</font> to get help regarding the game rules, and <font color='#FF0000'>!commands</font> to see the list of commands available.")
  82.     ui.addTextArea(1,"<b><p align = 'center'><font size='30'>Welcome to Truth or Dare Game!</font></p></b>",nil,50,365,700,40,0x324650,0x212F36,0.8,true)
  83.     answerer=""
  84.     questioner=""
  85.     begin=false
  86.     start=true
  87.     numplayers=0
  88.     count=1
  89.     one=false
  90.     for name,player in pairs(tfm.get.room.playerList) do
  91.         p[name]={questioners=false, admin=false, spectator=true, ban=false, new=false}
  92.         players[count]=name
  93.         timestamp=os.time()
  94.         numplayers=numplayers+1
  95.         count=count+1
  96.         p[name].spectator=false
  97.         p[name].questioners=false
  98.         if name==admin then
  99.             p[name].admin=true
  100.         end
  101.     end
  102.     system.disableChatCommandDisplay("t", hidden)
  103.     system.disableChatCommandDisplay("admin", hidden)
  104.     system.disableChatCommandDisplay("restart", hidden)
  105.     system.disableChatCommandDisplay("ban", hidden)
  106.     system.disableChatCommandDisplay("skip", hidden)
  107.     system.disableChatCommandDisplay("watch", hidden)
  108.     system.disableChatCommandDisplay("unban", hidden)
  109.     system.disableChatCommandDisplay("unadmin", hidden)
  110.     end
  111.  
  112. function eventChatCommand(name,command)
  113.     local IDList = {}
  114.     if command=="s" and p[name].admin==true then
  115.         tfm.exec.setShaman(name)
  116.     elseif command=="players" then
  117.         local i=1
  118.         local long=""
  119.         local hname=""
  120.         while i<=numplayers do
  121.             hname=players[i]
  122.             if p[hname].spectator==false and tfm.get.room.playerList[hname].isDead==false then
  123.                 long=long..tostring(players[i])..", "
  124.             end
  125.             i=i+1
  126.         end
  127.         tfm.exec.chatMessage("<font color='#00FF00'>The participating players are: "..string.sub(long,1,-3)..".</font>", name)
  128.     elseif command=="mods" then
  129.         message=""
  130.         for k,v in pairs(tfm.get.room.playerList) do
  131.             if p[k].admin==true then
  132.                 message=message..tostring(k)..", "
  133.             end
  134.         end
  135.     tfm.exec.chatMessage("<font size='20' color='#ED67EA'>The moderators of this game are: "..string.sub(message,1,-3)..".</font>", name)
  136.     elseif command=="new" and name==questioner then
  137.         if p[name].new==false then
  138.         tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  139.         answererold=answerer
  140.         answerer=""
  141.         choose=true
  142.         p[name].new=true
  143.         end
  144.     elseif command=="join" and p[name].spectator==true then
  145.         if p[name].ban==false then
  146.             tfm.exec.chatMessage("<b><font size='15'>"..name.." joined the game! :D</font></b>", nil)
  147.             tfm.exec.respawnPlayer(name)
  148.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  149.             p[name].spectator=false
  150.             table.insert(players,name)
  151.         elseif p[name].ban==true then
  152.             tfm.exec.chatMessage("<b>You have been banned, so u cannot join the game :(</b>", name)
  153.         end
  154.     elseif command=="skip" and p[name].admin==true then
  155.         timestamp=os.time()
  156.         skip=true
  157.     elseif string.sub(command,0,1) == "t" and p[name].admin==true then
  158.         message=string.sub(command,3)
  159.         tfm.exec.chatMessage("<font color='#ED67EA'>[~Moderation] "..message.."</font>", nil)
  160.     elseif command=="restart" and p[name].admin==true then
  161.         tfm.exec.newGame("@6411544")
  162.     elseif string.sub(command,0,5)=="watch"  then
  163.         if string.sub(command,7)=="" then
  164.             p[name].spectator=true
  165.                 tfm.exec.chatMessage("<b>"..name.." is now a spectator :(</b>")
  166.                 tfm.exec.chatMessage("<b>Type !join to join the game.</b>",name)
  167.             if name==questioner or name==answerer then
  168.                 questioner=""
  169.                 answerer=""
  170.                 tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  171.                 tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  172.                 timestamp=os.time()
  173.                 skip=true
  174.             end
  175.             for i=1,#players do
  176.                 if players[i]==name then
  177.                     table.remove(players,i)
  178.                 end
  179.             end
  180.         else
  181.             if p[name].admin==true then
  182.                 message=string.sub(command,7)
  183.                 message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  184.                 for k,v in pairs(tfm.get.room.playerList) do
  185.                     if k==message and p[k].spectator==false then
  186.                         if k==questioner or k==answerer then
  187.                             skip=true
  188.                             timestamp=os.time()
  189.                         end
  190.                         p[k].spectator=true
  191.                         tfm.exec.chatMessage(""..k.." is now a spectator :(", nil)
  192.                         tfm.exec.chatMessage("<b>Type !join to join the game.</b>",k)
  193.                         for i=1,#players do
  194.                             if players[i]==k then
  195.                                 table.remove(players,i)
  196.                             end
  197.                         end
  198.                     end
  199.                 end
  200.             end
  201.         end
  202.     elseif command=="respawn" then
  203.         tfm.exec.respawnPlayer(name)
  204.     elseif command=="help" then
  205.         tfm.exec.chatMessage("<font color='#FF0000'><b>Rules: </b></font>Every game, everyone will have the chance to be the Asker. On the first popup as an asker, u can click 'Yes' to randomize a answerer, or 'No' to type a particular person in room. This is similar for almost all other popups, where 'Yes' is for random and 'No' is for typing out yourself. There are currently <b>"..#truth.."</b> random truths and <b>"..#dare.."</b> random dares, so if you have any feedback feel free to tell me, Mousetat.\nRules: No swearing and no spamming.\n<font color='#00FF00'>CREATED BY MOUSETAT</font>\nForum Thread: http://atelier801.com//topic?f=6&t=814350&p=1 \n Type !commands to see the list of commands",name)
  206.     elseif command=="commands" then
  207.         if p[name].admin==false then
  208.         tfm.exec.chatMessage("<b><font color='#FFFF00'>COMMANDS</font>\n!players to see the participating players in game\n!join to join the game if you are spectating or if you just came into the room.\n!watch to be a spectator and get ignored in the game.\n!s to be shaman(although it is strongly not advised to do so)\n!new to get a new answerer(asker only)\n!help to see the rules of this game\n!mods to see the list of moderators.\n!commands to see the commands of this game.</b>",name)
  209.         elseif p[name].admin==true then
  210.         tfm.exec.chatMessage("<b><font color='#FFFF00'>COMMANDS</font>\n!players to see the participating players in game\n!join to join the game if you are spectating or if you just came into the room.\n!watch to be a spectator and get ignored in the game.\n!s to be shaman(although it is strongly not advised to do so)\n!new to get a new answerer(asker only)\n!help to see the rules of this game\n!commands to see the commands of this game.</b>",name)
  211.         tfm.exec.chatMessage("<font color='#ED67EA'>Admin commands:</font>\n!watch (username) to make the username a spectaor.(admins only)!admin (username) to admin a person(admins only)\n!t (message) to speak to all(admins only)\n!restart to restart game if bugged(admins only)\n!skip to skip a person's turn(admins only)\n!ban (username) (reason) to ban a person(highly not advised)",name)
  212.         end
  213.     elseif string.sub(command,0,3)=="ban" and p[name].admin==true then
  214.         local c=0
  215.         local reason=""
  216.         if string.find(command," ",5)==nil then
  217.             message=string.sub(command,5)
  218.         else
  219.             c=string.find(command," ",5)
  220.             print(c)
  221.             message=string.sub(command,5,c-1)
  222.             reason=string.sub(command,c+1)
  223.             print(reason)
  224.         end
  225.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  226.         for k,v in pairs(tfm.get.room.playerList) do
  227.             if message==k then
  228.                 tfm.exec.chatMessage("<font color='#ED67EA'>[~Moderation] "..message.." has been banned for 9999 hours. Reason: "..reason.."</font>", nil)
  229.                 p[message].ban=true
  230.                 tfm.exec.killPlayer(k)
  231.                 for i=1,#players do
  232.                     if players[i]==k then
  233.                         table.remove(players,i)
  234.                     end
  235.                 end
  236.             end
  237.         end
  238.     elseif string.sub(command,0,5)=="unban" and p[name].admin==true then
  239.         message=string.sub(command,7)
  240.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  241.         for k,v in pairs(tfm.get.room.playerList) do
  242.             if message==k then
  243.                 tfm.exec.chatMessage("<font color='#ED67EA'>[~Moderation] "..message.." has been unbanned.</font>", nil)
  244.                 p[message].ban=false
  245.                 tfm.exec.respawnPlayer(k)
  246.                 table.insert(players,k)
  247.             end
  248.         end
  249.     elseif string.sub(command,0,5)=="admin" and p[name].admin==true then
  250.         message=string.sub(command,7)
  251.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  252.         for k,v in pairs(tfm.get.room.playerList) do
  253.             if message==k then
  254.                 tfm.exec.chatMessage("<font color='#ED67EA'>[~Moderation] "..message.." is now a moderator. Congrats!</font>", nil)
  255.                 p[message].admin=true
  256.             end
  257.         end
  258.     elseif string.sub(command,0,7)=="unadmin" and p[name].admin==true then
  259.         message=string.sub(command,9)
  260.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  261.         for k,v in pairs(tfm.get.room.playerList) do
  262.             if message==k then
  263.                 tfm.exec.chatMessage("<font color='#ED67EA'>[~Moderation] "..message.." is demoded. What a waste!</font>", nil)
  264.                 p[message].admin=false
  265.             end
  266.         end
  267.     end
  268. end
  269.  
  270. function eventLoop(time,remaining)
  271.     numplayers=#players
  272.     for k,v in pairs(tfm.get.room.playerList) do
  273.         if p[k].ban==true then
  274.             ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>You have been banned. :(</font></p></b>",k)
  275.         elseif p[k].spectator==true then
  276.             ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",k)
  277.         end
  278.     end
  279.     local IDList={}
  280.     for id, object in pairs(tfm.get.room.objectList) do
  281.         table.insert(IDList, id)
  282.     end
  283.     for i, id in pairs(IDList) do
  284.         if others[id].summonobject==true and timestamplol[id]<os.time()-5000 then
  285.             tfm.exec.removeObject(id)
  286.             others[id].summonobject=false
  287.             if others[id].box==true then
  288.             tfm.exec.removeImage(others[id].image)
  289.             others[id].box=false
  290.             end
  291.         end
  292.     end
  293.     if numplayers<2 then
  294.         one=true
  295.     else
  296.         one=false
  297.     end
  298.     if one==true then
  299.         ui.updateTextArea(1, "<p align='center'><b><font size='15'>Minimum of 2 players are needed for this game to proceed.</font></b></p>", nil)
  300.         timestamp=os.time()-4000
  301.     elseif timestamp < os.time()-10000 and begin==false then
  302.         timestamp=os.time()
  303.         begin=true
  304.         restart=false
  305.         ui.updateTextArea(1, "<p align='center'><b><font size='30'>Let's Begin the Game! </font></b></p>", nil)
  306.         for name,player in pairs(tfm.get.room.playerList) do
  307.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  308.         end
  309.     elseif timestamp < os.time()-5000 and begin==false then
  310.         local i=1
  311.         local long=""
  312.         local hname=""
  313.         while i<=numplayers do
  314.             hname=players[i]
  315.             if p[hname].spectator==false and tfm.get.room.playerList[hname].isDead==false then
  316.                 long=long..tostring(players[i])..", "
  317.             end
  318.             i=i+1
  319.         end
  320.         ui.updateTextArea(1, "<p align='center'><b><font size='15'>The participating players are: "..string.sub(long,1,-3)..".</font></b></p>", nil)
  321.     elseif timestamp < os.time()-3000 and begin==false and restart==true then
  322.         ui.updateTextArea(1, "<p align='center'><b><font size='20'>Since everyone had their turn, I'll restart the game...", nil)
  323.     end
  324.     if begin==true then
  325.         if timestamp < os.time()-3000 and start==true then
  326.             tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  327.             tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  328.             answerer=""
  329.             questioner=""
  330.             local j=1
  331.             local i=0
  332.             while j<=numplayers do
  333.                 pname=players[j]
  334.                 if p[pname].questioners==false and tfm.get.room.playerList[pname].isDead==false and p[pname].spectator==false then
  335.                     i=i+1
  336.                 end
  337.                 j=j+1
  338.             end
  339.             if i>0 then
  340.                 eventTruthOrDare()
  341.             else
  342.                 local j=1
  343.             while j<=numplayers do
  344.                 local name=players[j]
  345.                 p[name].questioners=false
  346.                 j=j+1
  347.             end
  348.             restart=true
  349.             timestamp=os.time()
  350.             begin=false
  351.         end
  352.     end
  353.     if choose==true and one==false then
  354.         rand=math.random(1,numplayers)
  355.         answerer=players[rand]
  356.         if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or answerer==answererold then
  357.             ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  358.             tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  359.             answerer=""
  360.         else
  361.             choose=false
  362.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick truth or dare...</font></b>", nil)
  363.             ui.addPopup(3,1,"You are the answerer! Do you want Truth? If No, you will choose Dare!",answerer,250,50,300,true)
  364.         end
  365.     elseif choosey==true and one==false then
  366.         rand=math.random(1,numplayers)
  367.         questioner=players[rand]
  368.         if p[questioner].questioners==false and tfm.get.room.playerList[questioner].isDead==false and p[questioner].spectator==false then
  369.             choosey=false
  370.             p[questioner].questioners=true
  371.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is now the asker! Waiting to pick an answerer...</font></b>", nil)
  372.             ui.addPopup(1,1,"Do you want a random Answerer? If <b>No</b>, you will have to type in your Answerer's username",questioner,250,50,300,true)
  373.         else
  374.             ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  375.             tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  376.             questioner=""
  377.         end
  378.     end
  379.     if skip==true then
  380.         ui.updateTextArea(1, "<p align='center'><b><font size='30'>Skipping turn...</font></b></p>", nil)
  381.         tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  382.         tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  383.         answerer=""
  384.         questioner=""
  385.         if timestamp < os.time()-3000 then
  386.             start=true
  387.             skip=false
  388.         end
  389.     end
  390.     tfm.exec.movePlayer(questioner,120,120,false,0,0,false)
  391.     tfm.exec.movePlayer(answerer,680,120,false,0,0,false)
  392.     end
  393. end
  394.  
  395. function eventTruthOrDare()
  396.     start=false
  397.     ui.removeTextArea(2)
  398.     ui.removeTextArea(3)
  399.     choosey=true
  400. end
  401.  
  402. function eventPopupAnswer(id, name, answer)
  403.     if id==1 and name==questioner then
  404.         if answer=="yes" then
  405.             answererold=""
  406.             choose=true
  407.         elseif answer=="no" then
  408.             ui.addPopup(2,2,"Who do you want to be the answerer?",questioner,250,50,300,true)
  409.         end
  410.     elseif id==2 and name==questioner then
  411.         x=1
  412.         found=false
  413.         answer=string.upper(string.sub(answer,0,1))..string.sub(answer,2)
  414.         answer=string.gsub(answer, "<", "&lt;")
  415.         answer=string.gsub(answer, "http", "")
  416.         while x<=numplayers do
  417.         print(players[x])
  418.             if answer==players[x] then
  419.             answerer=answer
  420.             if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true then
  421.             answerer=""
  422.             found=false
  423.             else
  424.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick Truth or Dare...</font></b>", nil)
  425.             ui.addPopup(3,1,"You are the answerer! Do you want Truth? If <b>No</b>, you will choose Dare!",answerer,250,50,300,true)
  426.             found=true
  427.             end
  428.             end
  429.             x=x+1
  430.         end
  431.         if found==false then
  432.             ui.addPopup(2,2,"There is no such answerer in the room. Type out the exact username of your answerer.",questioner,250,50,300,true)
  433.         end
  434.     elseif id==3 and name==answerer then   
  435.         if answer=="yes" then
  436.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has picked Truth! Waiting for question from "..questioner.."...</font></b>", nil)  
  437.             ui.addPopup(4,1,"Do you want a random Truth question? If <b>No</b>, you will have to submit a question.",questioner,250,50,300,true)
  438.         elseif answer=="no" then
  439.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has picked Dare! Waiting for a dare from "..questioner.."...</font></b>", nil)
  440.             ui.addPopup(5,1,"Do you want a random Dare? If <b>No</b>, you will have to submit a Dare.",questioner,250,50,300,true)
  441.                
  442.         end
  443.     elseif id==4 and name==questioner then
  444.         if answer=="yes" then
  445.             question=truth[math.random(1,#truth)]
  446.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)
  447.             ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  448.             ui.addPopup(8,2,"<b>Type your Truth answer below</b>",answerer,250,175,300,true)
  449.            
  450.         elseif answer=="no" then
  451.             ui.addPopup(6,2,"Type your Truth question below.",questioner,250,50,300,true)
  452.         end
  453.     elseif id==5 and name==questioner then
  454.         if answer=="yes" then
  455.             question=dare[math.random(1,#dare)]
  456.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil) 
  457.             ui.addTextArea(2,"<b><font size='20'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  458.             ui.addPopup(9,1,"<b><font size='15'>Do what "..questioner.."dares you to do! If you click 'yes' you will promise that you will do your dare!</font><b>",answerer,250,175,300,true)
  459.         elseif answer=="no" then
  460.             ui.addPopup(7,2,"Type your Dare below.",questioner,250,50,300,true)
  461.         end
  462.     elseif id==6 and name==questioner then
  463.         if answer=="" then
  464.         ui.addPopup(6,2,"You have to type something as your Truth question.",questioner,250,50,300,true)
  465.         else
  466.         answer=string.gsub(answer, "http", "")
  467.         question=string.gsub(answer, "<", "&lt;")
  468.         ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)   
  469.         ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  470.         ui.addPopup(8,2,"Type your Truth answer below",answerer,250,175,300,true)
  471.         end
  472.     elseif id==7 and name==questioner then
  473.         if answer=="" then
  474.             ui.addPopup(7,2,"You have to type something as your Dare.",questioner,250,50,300,true)
  475.         else
  476.             answer=string.gsub(answer, "http", "")
  477.             question=string.gsub(answer, "<", "&lt;")
  478.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  479.             ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  480.             ui.addPopup(9,1,"<b><font size='15'>Do what "..questioner.."dares you to do! If you click 'yes' you will promise that you will do your dare!</font><b>",answerer,250,175,300,true)
  481.         end
  482.     elseif id==8 and name==answerer then
  483.         answer=string.gsub(answer, "http", "")
  484.         ans=string.gsub(answer, "<", "&lt;")
  485.         if ans=="" then
  486.         ui.addPopup(8,2,"You have to type something as your Truth Answer",answerer,250,175,300,true)
  487.         else
  488.         ui.addTextArea(3,"<b><font size='20'>Answer: "..ans.."</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  489.         ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has answered the question! Waiting for "..questioner.." to rate the answer</font></b>", nil)   
  490.         ui.addPopup(10,1,"<b><font size='15'>Are you satisfied with the answer?",questioner,250,50,300,true)
  491.         end
  492.     elseif id==9 and name==answerer then
  493.         if answer=="yes" then
  494.             ui.addTextArea(3,"<b><font size='20'>I, "..answerer..", accepts the challenge and promises to do the dare.</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  495.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a warrior! Starting new game...</font></b>", nil)   
  496.             timestamp=os.time()
  497.             answerer=""
  498.             questioner=""
  499.             start=true
  500.             for name,player in pairs(tfm.get.room.playerList) do
  501.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  502.             p[name].new=false
  503.             end        
  504.         elseif answer=="no" then
  505.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a coward! Starting new game...</font></b>", nil)
  506.             ui.addTextArea(3,"<b><font size='20'>I, "..answerer..", am a coward so I don't dare to do what you dared me to do.</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  507.             timestamp=os.time()
  508.             answerer=""
  509.             questioner=""
  510.             start=true
  511.             for name,player in pairs(tfm.get.room.playerList) do
  512.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  513.             p[name].new=false
  514.             end        
  515.         end
  516.     elseif id==10 and name==questioner then
  517.         if answer=="yes" then
  518.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a satisfied with the answer! Starting new game...</font></b>", nil)
  519.             timestamp=os.time()
  520.             answerer=""
  521.             questioner=""
  522.             start=true
  523.             for name,player in pairs(tfm.get.room.playerList) do
  524.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  525.             p[name].new=false
  526.             end
  527.         elseif answer=="no" then
  528.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a not satisfied with the answer...:( Starting new game...</font></b>", nil)
  529.             timestamp=os.time()
  530.             answerer=""
  531.             questioner=""
  532.             start=true         
  533.             for name,player in pairs(tfm.get.room.playerList) do
  534.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  535.             p[name].new=false
  536.             end
  537.         end
  538.     end
  539. end
  540.  
  541. function eventPlayerLeft(name)
  542.     tfm.exec.chatMessage("<font size='15'>"..name.." left the room... What a coward!</font>", nil)
  543.     if questioner==name or answerer==name then
  544.         timestamp=os.time()
  545.         skip=true
  546.     end
  547.     for i=1,#players do
  548.         if players[i]==name then
  549.         table.remove(players,i)
  550.         end
  551.     end
  552. end
  553.  
  554. function eventPlayerDied(name)
  555.     if p[name].spectator==false then
  556.         tfm.exec.respawnPlayer(name)
  557.     end
  558.     if p[name].ban==true then
  559.         tfm.exec.killPlayer(name)
  560.         if name==questioner or name==answerer then
  561.             timestamp=os.time()
  562.             skip=true
  563.         end
  564.     end
  565. end
  566.  
  567. function eventPlayerWon(playerName,timeElapsed)
  568. tfm.exec.respawnPlayer(playerName)
  569. end
  570.  
  571. function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, other)
  572. timestamplol[other.id]=os.time()
  573. others[other.id]={summonobject=true}
  574. local shamid=tostring(other.id)
  575. if objectType==2 then
  576. imageID=tfm.exec.addImage("nhvLuQy.png", "#"..shamid, -30, -30,nil)
  577. others[other.id]={summonobject=true, box=true, image=imageID}
  578. elseif objectType==1 then
  579. imageID=tfm.exec.addImage("Upncqqm.png","#"..shamid, -15, -15,nil)
  580. others[other.id]={summonobject=true, box=true, image=imageID}
  581. elseif objectType==6 then
  582. imageID=tfm.exec.addImage("1Sg9gfU.png","#"..shamid, -21,-30,nil)
  583. others[other.id]={summonobject=true, box=true, image=imageID}
  584. end
  585. end
Advertisement
Add Comment
Please, Sign In to add comment