SHARE
TWEET

Untitled

a guest May 22nd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. admins={"Lololofare", "Mikelz"}
  2. -- remember to put "," between each name!
  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. dance=false
  34. mapcomplete=false
  35.  
  36. truth={}--you can follow the format 'truth[number]="question"'
  37. truth[1]="Who is your crush in this game?"
  38. truth[2]="What is your favourite food?"
  39. truth[3]="Who is your model/favourite person in game?"
  40. truth[4]="What games do you play besides Transformice?"
  41. truth[5]="What would you like to be when you grow up?"
  42. truth[6]="Have you sucked your thumb before?"
  43. truth[7]="What brand of phone do you have currently?"
  44. truth[8]="Have you ever farted in front of your friends or teachers in real life?"
  45. truth[9]="If you could hack transformice, what would you do?"
  46. truth[10]="What is your favourite fur in Transformice if you have to choose?"
  47. truth[11]="Why do you like Transformice?"
  48. truth[12]="What do you dislike/hate most about yourself, whether in personality or physically?"
  49. truth[13]="What do you love most about yourself, whether in personality or physically?"
  50. truth[14]="Tell us whether you love yourself more or hate/dislike yourself more, and tell us why."
  51. truth[15]="Why do you like your current crush in real life, in personality terms AND physical terms?"
  52. truth[16]="Tell us why you hate the person you currently hate in real life, in personality terms."
  53. truth[17]="If you had unlimited cheese and fraises, what item would you buy from the shop?"
  54. truth[18]="Which will you choose, free million of cash or living longer?"
  55. truth[19]="What is your favourite board game?"
  56. truth[20]="What is the longest that you have ever been without taking a shower?"
  57. truth[21]="Have you ever eaten an insect before?"
  58. truth[22]="If you could be any super villain, who would you be?"
  59. truth[23]="If you could be any superhero, who would you be?"
  60. truth[24]="If you could be an insect, what would you be?"
  61. truth[25]="Who is your favourite staff?(Admin/Moderator/Sentinels/Mapcrew/Funcorp)"
  62. truth[26]="What is your impression of me? Do you like me?"
  63. truth[27]="Have you ever cheated on any test?"
  64. truth[28]="How many boyfriends/girlfriends have you had?"
  65. truth[29]="If you were a billionaire, what would you spend your time doing?"
  66. truth[30]="If you could be a boss of a company one day, what would you do?"
  67. truth[31]="What celebrity are you obsessed with?"
  68. truth[32]="What is your favourite sports team/player?"
  69. truth[32]="What is your favourite song that is out right now?"
  70. truth[33]="If you were on an island with a person and yourself only, who would you want the person to be?(the person must be in this room)"
  71. truth[34]="If you could marry, kiss, hug, punch and kill someone in this room, who would they be?(if there are less than 5 mice you can repeat names)"
  72. truth[35]="Would rather be rich but dumb, or poor but clever?"
  73. truth[36]="Are you closer to your mother or your father?"
  74. truth[37]="Do you like anyone besides your soulmate? If yes, who?"
  75. truth[38]="Do have multiple crushes in real life or in tfm? If yes, how many do you have? If they are in tfm, who are they?? "
  76.  
  77. dare={}--you can follow the format 'dare[number]="Dare"'
  78. dare[1]="I dare you go into EN/EN2 room 2 and spam this message 10 times: CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE"
  79. dare[2]="I dare you whisper a moderator a swear word."
  80. dare[3]="I dare you tell your crush, or anybody in this room that you love him/her right now"
  81. dare[4]="I dare you go into EN/EN2 room 1 and spam this message 10 times: I'M FLOODING REPORT ME!"
  82. dare[5]="I dare you report a moderator for hacking"
  83. dare[6]="I dare you use all the fireworks that you have in your inventory here in this room!"
  84. dare[7]="I dare you tell your real life name to everybody in chat"
  85. dare[8]="I dare you take a picture of your real life face and send it to everyone to see."
  86. dare[9]="I dare you go into any #utility room with at least 3 people in it and crash the room."
  87. dare[10]="I dare you give me, the questioner, every ball you have in your inventory, if you have any."
  88. dare[11]="I dare you to disconnect and reconnect right now."
  89. dare[12]="I dare you to say who would be your most likely crush among the players in this room we are in."
  90. dare[13]="I dare you to give all your selfies to me right now, if you have any balls to do it via trade"
  91. dare[14]="I dare you complete this map without cheating!"
  92. 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."
  93. dare[16]="I dare you kiss me, the questioner, 20 times :)"
  94. dare[17]="I dare you marry your closest friend, if u are not already married"
  95. dare[18]="I dare you give me, the questioner, every snowball you have in your inventory, if you have any."
  96. dare[19]="I dare you whisper a moderator, 'Ban me!'"
  97. dare[20]="I dare you kiss and hug someone in the room of the same gender"
  98. dare[21]="I dare you spam 'I AM A DUMB COWARD!' 10 times in this room's chat"
  99. dare[22]="I dare you ask your crush for a date."
  100. dare[23]="I dare you spam to a moderator 10 times, 'HEY <moderator's name>, I'M DAD'"
  101. dare[24]="I dare you go to a room in EN/EN2 and type 'I WANT WAFFLES' 5 times."
  102. dare[25]="I dare you go to cafe and create a topic: 'I LOVE UNDERTALE'"
  103. dare[26]="I dare you go to /room village1 and say to a random person there, 'OMG I LOVE YOU (insert random person's name) FRIEND ME I ALWAYS WANTED TO MEET YOU OMG!!! *-*'"
  104. dare[27]="If you have powers to kick someone from the tribe, I dare you kick a particular person from your tribe, then invite him back again. If you don't have the powers, I dare you leave the tribe and ask someone to invite you back."
  105.  
  106. function eventNewPlayer(name)
  107.     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)
  108.     ui.addPopup(999,0,"<p align = 'center'><font size='40' face='impact'>Truth or Dare</font></p><font size='20' color='#FF0000'><b>About the game</b></font><font size='15'>\nEvery 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. If you are the asker, you can also type '#(number)' to give the question number of the truth/dare in the random list. 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.\n<font color='#00FF00'>Created by Mousetat</font> \nForum Thread: atelier801.com//topic?f=6&t=814350&p=1 \n</font><font face='impact' size='30'>Type !commands to see the list of commands</font>",name,100,50,600,true)
  109.     p[name]={questioners=false, admin=false, spectator=true, ban=false, randomerino=1, out=false, new=false}
  110.     local i=0
  111.     while i<=#admins do
  112.     if name==admins[i] then
  113.         p[name].admin=true
  114.     end
  115.     i=i+1
  116.     end
  117. end
  118.  
  119. function eventNewGame()
  120.     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)
  121.     ui.addPopup(999,0,"<p align = 'center'><font size='40' face='impact'>Truth or Dare</font></p><font size='20' color='#FF0000'><b>About the game</b></font><font size='15'>\nEvery 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. If you are the asker, you can also type '#(number)' to give the question number of the truth/dare in the random list. 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.\n<font color='#00FF00'>Created by Mousetat</font> \nForum Thread: atelier801.com//topic?f=6&t=814350&p=1 \n</font><font face='impact' size='30'>Type !commands to see the list of commands</font>",nil,100,50,600,true)
  122.     answerer=""
  123.     questioner=""
  124.     begin=false
  125.     start=true
  126.     numplayers=0
  127.     count=1
  128.     one=false
  129.     local i=0
  130.     for name,player in pairs(tfm.get.room.playerList) do
  131.         p[name]={questioners=false, admin=false, spectator=true, ban=false, randomerino=1, out=false, new=false}
  132.         players[count]=name
  133.         timestamp=os.time()
  134.         numplayers=numplayers+1
  135.         count=count+1
  136.         p[name].spectator=false
  137.         p[name].questioners=false
  138.         local i=0
  139.         while i<=#admins do
  140.         if name==admins[i] then
  141.             p[name].admin=true
  142.         end
  143.         i=i+1
  144.         end
  145.     end
  146.     system.disableChatCommandDisplay("t", hidden)
  147.     system.disableChatCommandDisplay("admin", hidden)
  148.     system.disableChatCommandDisplay("restart", hidden)
  149.     system.disableChatCommandDisplay("ban", hidden)
  150.     system.disableChatCommandDisplay("skip", hidden)
  151.     system.disableChatCommandDisplay("watch", hidden)
  152.     system.disableChatCommandDisplay("unban", hidden)
  153.     system.disableChatCommandDisplay("unadmin", hidden)
  154.     end
  155.  
  156. function eventChatCommand(name,command)
  157.     local IDList = {}
  158.     if command=="clear" then
  159.         for id, object in pairs(tfm.get.room.objectList) do
  160.             table.insert(IDList, id)
  161.         end
  162.         for i, id in pairs(IDList) do
  163.             tfm.exec.removeObject(id)
  164.         end
  165.     end
  166.     if command=="s" and p[name].admin==true then
  167.         tfm.exec.setShaman(name)
  168.     elseif command=="dance" and p[name].admin==true then
  169.         for name,player in pairs(tfm.get.room.playerList) do
  170.             p[name].randomerino=math.random(1,3)
  171.         end
  172.         dance=true
  173.     elseif command=="danceoff" and p[name].admin==true then
  174.         dance=false
  175.     elseif command=="mods" then
  176.         message=""
  177.         for k,v in pairs(tfm.get.room.playerList) do
  178.             if p[k].admin==true then
  179.                 message=message..tostring(k)..", "
  180.             end
  181.         end
  182.     ui.updateTextArea(1, "<p align='center'><b><font size='15'>The moderators are: "..string.sub(message,1,-3)..".</font></b></p>", name)
  183.     elseif command=="new" and name==questioner then
  184.         if p[name].new==false then
  185.         print("true")
  186.         tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  187.         answererold=answerer
  188.         answerer=""
  189.         choose=true
  190.         p[name].new=true
  191.         else
  192.         ui.updateTextArea(1, "<p align='center'><b><font size='30'>You can only !new ONCE</font></b></p>", nil)
  193.         end
  194.     elseif command=="join" and p[name].spectator==true then
  195.         if p[name].ban==false then
  196.             ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..name.." joined the game! :D</font></b></p>", nil)
  197.             tfm.exec.respawnPlayer(name)
  198.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  199.             p[name].spectator=false
  200.             table.insert(players,name)
  201.         elseif p[name].ban==true then
  202.             ui.updateTextArea(1, "<p align='center'><b><font size='30'>You have been banned, so u cannot join the game :(</font></b></p>", name)
  203.         end
  204.     elseif command=="skip" and p[name].admin==true then
  205.         timestamp=os.time()
  206.         skip=true
  207.     elseif string.sub(command,0,1) == "t" and p[name].admin==true then
  208.         message=string.sub(command,3)
  209.         ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~#T/D Moderation] "..message.."</font></b></p>", nil)
  210.     elseif command=="restart" and p[name].admin==true then
  211.         tfm.exec.newGame("@6411544")
  212.     elseif string.sub(command,0,5)=="watch"  then
  213.         if string.sub(command,7)=="" then
  214.             p[name].spectator=true
  215.                 ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..name.." is now a spectator :(</font></b></p>", nil)
  216.                 ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",name)
  217.             if name==questioner or name==answerer then
  218.                 questioner=""
  219.                 answerer=""
  220.                 tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  221.                 tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  222.                 timestamp=os.time()
  223.                 skip=true
  224.             end
  225.             for i=1,#players do
  226.                 if players[i]==name then
  227.                     table.remove(players,i)
  228.                 end
  229.             end
  230.         else
  231.             if p[name].admin==true then
  232.                 message=string.sub(command,7)
  233.                 message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  234.                 for k,v in pairs(tfm.get.room.playerList) do
  235.                     if k==message and p[k].spectator==false then
  236.                         if k==questioner or k==answerer then
  237.                             skip=true
  238.                             timestamp=os.time()
  239.                         end
  240.                         p[k].spectator=true
  241.                         ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..k.." is now a spectator :(</font></b></p>", nil)
  242.                         ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",k)
  243.                         for i=1,#players do
  244.                             if players[i]==k then
  245.                                 table.remove(players,i)
  246.                             end
  247.                         end
  248.                     end
  249.                 end
  250.             end
  251.         end
  252.     elseif command=="help" then
  253.         ui.addPopup(999,0,"<p align = 'center'><font size='40' face='impact'>Truth or Dare</font></p><font size='20' color='#FF0000'><b>About the game</b></font><font size='15'>\nEvery 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. If you are the asker, you can also type '#(number)' to give the question number of the truth/dare in the random list. 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.\n<font color='#00FF00'>Created by Mousetat</font> \nForum Thread: atelier801.com//topic?f=6&t=814350&p=1 \n</font><font face='impact' size='30'>Type !commands to see the list of commands</font>",name,100,50,600,true)
  254.     elseif command=="commands" then
  255.     if p[name].admin==true then
  256.     ui.addPopup(999,0,"<b><font size='20' color='#FFFF00'>COMMANDS</font>\n!join to join the game if you are spectating or you just came into the room.\n!watch to be a spectator and get ignored in the game.\n!mods to see the current moderators in the room.\n!clear to clear all shaman objects.\n!new to get a new answerer(only new ONCE)(asker only)\n!help to see the information about game\n<font size='20' color='#EB1D51'>ADMIN COMMANDS</font>\n!watch (username) to make the username a spectator.\n!s to become shaman\n!admin (username) to admin a person\n!dance/!danceoff to toggle dancing\n!t (message) to speak to all\n!restart to restart game if bugged\n!skip to skip a person's turn\n!ban (username) (reason) to ban a person(highly not advised)</b>",name,100,50,600,true)
  257.     elseif p[name].admin==false then
  258.     ui.addPopup(999,0,"<b><font size='20' color='#FFFF00'>COMMANDS</font>\n!join to join the game if you are spectating or you just came into the room.\n!watch to be a spectator and get ignored in the game.\n!mods to see the current moderators in the room.\n!clear to clear all shaman objects.\n!new to get a new answerer(only new ONCE)(asker only)\n!help to see the information about game",name,100,50,600,true)
  259.     end
  260.     elseif string.sub(command,0,3)=="ban" and p[name].admin==true then
  261.         local c=0
  262.         local reason=""
  263.         if string.find(command," ",5)==nil then
  264.             message=string.sub(command,5)
  265.         else
  266.             c=string.find(command," ",5)
  267.             print(c)
  268.             message=string.sub(command,5,c-1)
  269.             reason=string.sub(command,c+1)
  270.             print(reason)
  271.         end
  272.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  273.         for k,v in pairs(tfm.get.room.playerList) do
  274.             if message==k then
  275.                 ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~#T/D Moderation] "..message.." has been banned for 9999 hours. Reason: "..reason.."</font></b></p>", nil)
  276.                 p[message].ban=true
  277.                 tfm.exec.killPlayer(k)
  278.                 for i=1,#players do
  279.                     if players[i]==k then
  280.                         table.remove(players,i)
  281.                     end
  282.                 end
  283.             end
  284.         end
  285.     elseif string.sub(command,0,5)=="unban" and p[name].admin==true then
  286.         message=string.sub(command,7)
  287.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  288.         for k,v in pairs(tfm.get.room.playerList) do
  289.             if message==k then
  290.                 ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~#T/D Moderation] "..message.." has been unbanned.</font></b></p>", nil)
  291.                 p[message].ban=false
  292.                 tfm.exec.respawnPlayer(k)
  293.                 table.insert(players,k)
  294.             end
  295.         end
  296.     elseif string.sub(command,0,5)=="admin" and p[name].admin==true then
  297.         message=string.sub(command,7)
  298.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  299.         for k,v in pairs(tfm.get.room.playerList) do
  300.             if message==k then
  301.                 ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~#T/D Moderation] "..message.." is now a moderator. Congrats!</font></b></p>", nil)
  302.                 p[message].admin=true
  303.             end
  304.         end
  305.     elseif string.sub(command,0,7)=="unadmin" and p[name].admin==true then
  306.         message=string.sub(command,9)
  307.         message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  308.         for k,v in pairs(tfm.get.room.playerList) do
  309.             if message==k then
  310.                 ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~#T/D Moderation] "..message.." is demoded. What a waste!</font></b></p>", nil)
  311.                 p[message].admin=false
  312.             end
  313.         end
  314.     end
  315. end
  316.  
  317. function eventLoop(time,remaining)
  318.     if time>1000 then
  319.     if dance==true then
  320.         for name,player in pairs(tfm.get.room.playerList) do
  321.             if p[name].randomerino==1 then
  322.                 tfm.exec.playEmote(name,0,nil)
  323.             elseif p[name].randomerino==2 then
  324.                 tfm.exec.playEmote(name,15,nil)
  325.             elseif p[name].randomerino==3 then
  326.                 tfm.exec.playEmote(name,16,nil)
  327.             end
  328.         end
  329.     end
  330.     numplayers=#players
  331.     for k,v in pairs(tfm.get.room.playerList) do
  332.         if p[k].ban==true then
  333.             ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>You have been banned. :(</font></p></b>",k)
  334.         elseif p[k].spectator==true then
  335.             ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",k)
  336.         end
  337.     end
  338.     local IDList={}
  339.     for id, object in pairs(tfm.get.room.objectList) do
  340.         table.insert(IDList, id)
  341.     end
  342.     for i, id in pairs(IDList) do
  343.         if others[id].summonobject==true and timestamplol[id]<os.time()-3000 then
  344.             tfm.exec.removeObject(id)
  345.             others[id].summonobject=false
  346.         end
  347.     end
  348.     if numplayers<2 then
  349.         one=true
  350.     else
  351.         one=false
  352.     end
  353.     if one==true then
  354.         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)
  355.         timestamp=os.time()-4000
  356.     elseif timestamp < os.time()-10000 and begin==false then
  357.         timestamp=os.time()
  358.         begin=true
  359.         restart=false
  360.         ui.updateTextArea(1, "<p align='center'><b><font size='30'>Let's Begin the Game! </font></b></p>", nil)
  361.         for name,player in pairs(tfm.get.room.playerList) do
  362.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  363.         end
  364.     elseif timestamp < os.time()-5000 and begin==false then
  365.         local i=1
  366.         local long=""
  367.         local hname=""
  368.         while i<=numplayers do
  369.             hname=players[i]
  370.             if p[hname].spectator==false and tfm.get.room.playerList[hname].isDead==false and p[hname].out==false then
  371.                 long=long..tostring(players[i])..", "
  372.             end
  373.             i=i+1
  374.         end
  375.         ui.updateTextArea(1, "<p align='center'><b><font size='15'>The participating players are: "..string.sub(long,1,-3)..".</font></b></p>", nil)
  376.     elseif timestamp < os.time()-3000 and begin==false and restart==true then
  377.         ui.updateTextArea(1, "<p align='center'><b><font size='20'>Since everyone had their turn, I'll restart the game...", nil)
  378.     end
  379.     if begin==true then
  380.         if timestamp < os.time()-3000 and start==true then
  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.             local j=1
  386.             local i=0
  387.             while j<=numplayers do
  388.                 pname=players[j]
  389.                 if p[pname].questioners==false and tfm.get.room.playerList[pname].isDead==false and p[pname].spectator==false and p[pname].out==false then
  390.                     i=i+1
  391.                 end
  392.                 j=j+1
  393.             end
  394.             if i>0 then
  395.                 eventTruthOrDare()
  396.             else
  397.                 local j=1
  398.             while j<=numplayers do
  399.                 local name=players[j]
  400.                 p[name].questioners=false
  401.                 j=j+1
  402.             end
  403.             restart=true
  404.             timestamp=os.time()
  405.             begin=false
  406.         end
  407.     end
  408.     if choose==true and one==false then
  409.         rand=math.random(1,numplayers)
  410.         answerer=players[rand]
  411.         if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or answerer==answererold or p[answerer].out==true then
  412.             ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  413.             tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  414.             answerer=""
  415.         else
  416.             choose=false
  417.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick truth or dare...</font></b>", nil)
  418.             ui.addPopup(3,1,"You are the answerer! Do you want Truth? If No, you will choose Dare!",answerer,250,50,300,true)
  419.         end
  420.     elseif choosey==true and one==false then
  421.         rand=math.random(1,numplayers)
  422.         questioner=players[rand]
  423.         if p[questioner].questioners==false and tfm.get.room.playerList[questioner].isDead==false and p[questioner].spectator==false or p[questioner].out==false then
  424.             choosey=false
  425.             p[questioner].questioners=true
  426.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is now the asker! Waiting to pick an answerer...</font></b>", nil)
  427.             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)
  428.         else
  429.             ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  430.             tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  431.             questioner=""
  432.         end
  433.     end
  434.     if skip==true then
  435.         ui.updateTextArea(1, "<p align='center'><b><font size='30'>Skipping turn...</font></b></p>", nil)
  436.         tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  437.         tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  438.         answerer=""
  439.         questioner=""
  440.         if timestamp < os.time()-3000 then
  441.             start=true
  442.             skip=false
  443.         end
  444.     end
  445.     tfm.exec.movePlayer(questioner,120,120,false,0,0,false)
  446.     tfm.exec.movePlayer(answerer,680,120,false,0,0,false)
  447.     end
  448. end
  449. end
  450.  
  451. function eventTruthOrDare()
  452.     start=false
  453.     ui.removeTextArea(2)
  454.     ui.removeTextArea(3)
  455.     choosey=true
  456. end
  457.  
  458. function eventPopupAnswer(id, name, answer)
  459.     if id==1 and name==questioner then
  460.         if answer=="yes" then
  461.             answererold=""
  462.             choose=true
  463.         elseif answer=="no" then
  464.             ui.addPopup(2,2,"Who do you want to be the answerer?",questioner,250,50,300,true)
  465.         end
  466.     elseif id==2 and name==questioner then
  467.         x=1
  468.         found=false
  469.         answer=string.upper(string.sub(answer,0,1))..string.sub(answer,2)
  470.         answer=string.gsub(answer, "<", "&lt;")
  471.         answer=string.gsub(answer, "http", "")
  472.         while x<=numplayers do
  473.         print(players[x])
  474.             if answer==players[x] then
  475.             answerer=answer
  476.             if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or p[answerer].out==true then
  477.             answerer=""
  478.             found=false
  479.             else
  480.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick Truth or Dare...</font></b>", nil)
  481.             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)
  482.             found=true
  483.             end
  484.             end
  485.             x=x+1
  486.         end
  487.         if found==false then
  488.             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)
  489.         end
  490.     elseif id==3 and name==answerer then   
  491.         if answer=="yes" then
  492.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has picked Truth! Waiting for question from "..questioner.."...</font></b>", nil)  
  493.             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)
  494.         elseif answer=="no" then
  495.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has picked Dare! Waiting for a dare from "..questioner.."...</font></b>", nil)
  496.             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)
  497.                
  498.         end
  499.     elseif id==4 and name==questioner then
  500.         if answer=="yes" then
  501.             question=truth[math.random(1,#truth)]
  502.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)
  503.             ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  504.             ui.addPopup(8,2,"<b>Type your Truth answer below</b>",answerer,250,175,300,true)
  505.            
  506.         elseif answer=="no" then
  507.             ui.addPopup(6,2,"Type your Truth question below, or type #(number) for the question number from the random list.",questioner,250,50,300,true)
  508.         end
  509.     elseif id==5 and name==questioner then
  510.         if answer=="yes" then
  511.             question=dare[math.random(1,#dare)]
  512.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil) 
  513.             ui.addTextArea(2,"<b><font size='20'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  514.             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)
  515.         elseif answer=="no" then
  516.             ui.addPopup(7,2,"Type your Dare below, or type #(number) for the dare number from the random list.",questioner,250,50,300,true)
  517.         end
  518.     elseif id==6 and name==questioner then
  519.         answer=string.gsub(answer, "<", "&lt;")
  520.         answer=string.gsub(answer, "http", "")
  521.         if answer=="" then
  522.         ui.addPopup(6,2,"You have to type something as your Truth question.",questioner,250,50,300,true)
  523.         elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))<=#truth then
  524.         question=truth[tonumber(string.sub(answer,2,3))]
  525.         ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)   
  526.         ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  527.         ui.addPopup(8,2,"Type your Truth answer below",answerer,250,175,300,true)
  528.         elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))>#truth then
  529.         ui.addPopup(6,2,"You have to type a Truth question number less than or equal to "..tostring(#truth),questioner,250,50,300,true)
  530.         else
  531.         question=answer
  532.         ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)   
  533.         ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  534.         ui.addPopup(8,2,"Type your Truth answer below",answerer,250,175,300,true)
  535.         end
  536.     elseif id==7 and name==questioner then
  537.         answer=string.gsub(answer, "<", "&lt;")
  538.         answer=string.gsub(answer, "http", "")
  539.         if answer=="" then
  540.             ui.addPopup(7,2,"You have to type something as your Dare.",questioner,250,50,300,true)
  541.         elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))<=#dare then
  542.             if tonumber(string.sub(answer,2,3))==14 then
  543.             mapcomplete=true
  544.             end
  545.             question=dare[tonumber(string.sub(answer,2,3))]
  546.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  547.             ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  548.             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)
  549.         elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))>#dare then
  550.         ui.addPopup(7,2,"You have to type a Dare number less than or equal to "..tostring(#dare),questioner,250,50,300,true)
  551.         else
  552.             question=answer
  553.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  554.             ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  555.             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)
  556.         end
  557.     elseif id==8 and name==answerer then
  558.         answer=string.gsub(answer, "<", "&lt;")
  559.         answer=string.gsub(answer, "http", "")
  560.         ans = answer
  561.         if ans=="" then
  562.         ui.addPopup(8,2,"You have to type something as your Truth Answer",answerer,250,175,300,true)
  563.         else
  564.         ui.addTextArea(3,"<b><font size='20'>Answer: "..ans.."</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  565.         ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has answered the question! Waiting for "..questioner.." to rate the answer</font></b>", nil)   
  566.         ui.addPopup(10,1,"<b><font size='15'>Are you satisfied with the answer?",questioner,250,50,300,true)
  567.         end
  568.     elseif id==9 and name==answerer then
  569.         if answer=="yes" then
  570.             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)
  571.             if mapcomplete==true then
  572.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a warrior! He/she will have to complete the map before entering the game. Starting new game...</font></b>", nil)
  573.             p[answerer].out=true
  574.             mapcomplete=false
  575.             for i=1,#players do
  576.                 if players[i]==answerer then
  577.                     table.remove(players,i)
  578.                 end
  579.             end
  580.             else
  581.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a warrior! Starting new game...</font></b>", nil)   
  582.             end
  583.             timestamp=os.time()
  584.             answerer=""
  585.             questioner=""
  586.             start=true
  587.             for name,player in pairs(tfm.get.room.playerList) do
  588.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  589.             p[name].new=false
  590.             print("false")
  591.             end        
  592.         elseif answer=="no" then
  593.             mapcomplete=false
  594.             ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a coward! Starting new game...</font></b>", nil)
  595.             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)
  596.             timestamp=os.time()
  597.             answerer=""
  598.             questioner=""
  599.             start=true
  600.             for name,player in pairs(tfm.get.room.playerList) do
  601.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  602.             p[name].new=false
  603.             print("false")
  604.             end        
  605.         end
  606.     elseif id==10 and name==questioner then
  607.         if answer=="yes" then
  608.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a satisfied with the answer! Starting new game...</font></b>", nil)
  609.             timestamp=os.time()
  610.             answerer=""
  611.             questioner=""
  612.             start=true
  613.             for name,player in pairs(tfm.get.room.playerList) do
  614.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  615.             p[name].new=false
  616.             print("false")
  617.             end
  618.         elseif answer=="no" then
  619.             ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a not satisfied with the answer...:( Starting new game...</font></b>", nil)
  620.             timestamp=os.time()
  621.             answerer=""
  622.             questioner=""
  623.             start=true         
  624.             for name,player in pairs(tfm.get.room.playerList) do
  625.             tfm.exec.movePlayer(name,400,320,false,0,0,false)
  626.             p[name].new=false
  627.             print("false")
  628.             end
  629.         end
  630.     end
  631. end
  632.  
  633. function eventPlayerLeft(name)
  634.     ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..name.." left the room... What a coward!</font></b></p>", nil)
  635.     if questioner==name or answerer==name then
  636.         timestamp=os.time()
  637.         skip=true
  638.     end
  639.     for i=1,#players do
  640.         if players[i]==name then
  641.         table.remove(players,i)
  642.         end
  643.     end
  644. end
  645.  
  646. function eventPlayerDied(name)
  647.     if p[name].spectator==false then
  648.         tfm.exec.respawnPlayer(name)
  649.     end
  650.     if p[name].ban==true then
  651.         tfm.exec.killPlayer(name)
  652.         if name==questioner or name==answerer then
  653.             timestamp=os.time()
  654.             skip=true
  655.         end
  656.     end
  657. end
  658.  
  659. function eventPlayerWon(playerName,timeElapsed, timeElapsedSinceRespawn)
  660. tfm.exec.respawnPlayer(playerName)
  661. if p[playerName].out==true then
  662. p[playerName].out=false
  663. table.insert(players,playerName)
  664. print("yes")
  665. ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..playerName.." completed the map in "..(timeElapsedSinceRespawn/100).." seconds! He/she has joined back the game!</font></b></p>", nil)
  666. else
  667. ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..playerName.." completed the map in "..(timeElapsedSinceRespawn/100).." seconds!</font></b></p>", nil)
  668. end
  669. end
  670.  
  671. function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, other)
  672. timestamplol[other.id]=os.time()
  673. others[other.id]={summonobject=true}
  674. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top