Mousetat

truth or dare script

Mar 16th, 2020
1,057
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.00 KB | None | 0 0
  1. -- Module [mousetat] by Tat#0095
  2.  
  3. -- Module [mousetat] by Tat#0020
  4.  
  5. -- Module [mousetat] by Tat#0020
  6.  
  7. permadmins = {"Tat#0095", "Camelshet#3165", "Leafileaf#0000", "Coralbee#0000", "Ykr#0000", "Yuba#2381", "Papero#9240", "Leetinsanity#0020", "Wangan#0015", "Katow#0020", "Kinhusxd#0015", "Nattorei#0010", "B1k#0020", "Hobothehill#0000", "Pikashu#0001", "Shamousey#0015", "Killerlux#0010","Secretive#0010", "Coralpearl#0000", "Link#3301", "Sebaisseba#0020"}
  8.  
  9. -- remember to put "," between each name!
  10. print(tfm.get.room.name)
  11.  
  12. tfm.exec.disableAutoNewGame(true)
  13. tfm.exec.disableAfkDeath(true)
  14. tfm.exec.disableAutoShaman(true)
  15. tfm.exec.disableAutoScore(true)
  16. tfm.exec.newGame("@6411544")
  17.  
  18. players={}--respawn place is 400,320
  19. p={}
  20. timestamp=os.time()
  21. numplayers=0
  22.  
  23. begin=false
  24. answerer="lol"
  25. questioner="lol"
  26. question="lol"
  27. ans="lol"
  28. new=false
  29. restart=false
  30. choose=false
  31. start=true
  32. choosey=false
  33. skip=false
  34. message=""
  35. others={}
  36. summonobject=false
  37. timestamplol={}
  38. answererold=""
  39. one=false
  40. dance=false
  41. mapcomplete=false
  42.  
  43. truth={}--you can follow the format 'truth[number]="question"'
  44. truth[1]="Who is your crush in this game?"
  45. truth[2]="Would you rather receive sweet lies or painful truths? Why?"
  46. truth[3]="Who is your model/favourite person in game?"
  47. truth[4]="What games do you play besides Transformice?"
  48. truth[5]="What would you like to be when you grow up?"
  49. truth[6]="What is the first thing you would do if you had the power of invisibility?"
  50. truth[7]="What brand of phone do you have currently?"
  51. truth[8]="Have you ever farted in front of your friends or teachers in real life?"
  52. truth[9]="If you could hack transformice, what would you do?"
  53. truth[10]="What is your favourite fur in Transformice if you have to choose?"
  54. truth[11]="Why do you like Transformice?"
  55. truth[12]="Would you rather have super strong arms, or super strong legs?"
  56. truth[13]="Which one would you choose: A ring that vibrates if someone it detects someone lying, or a backpack which can store infinite number of items(no humans)?"
  57. truth[14]="Tell us your name in real life"
  58. truth[15]="Why do you like your current crush in real life, in personality terms AND physical terms?"
  59. truth[16]="Tell us why you hate the person you currently hate in real life, in personality terms."
  60. truth[17]="If you had unlimited cheese and fraises, what item would you buy from the shop?"
  61. truth[18]="Which will you choose, free million of cash or living longer?"
  62. truth[19]="What is your favourite board game?"
  63. truth[20]="What is the longest that you have ever been without taking a shower?"
  64. truth[21]="Have you ever eaten an insect before? How do you think they taste like/will taste like, if you had one?"
  65. truth[22]="If you could be any super villain, who would you be?"
  66. truth[23]="If you could be any superhero, who would you be?"
  67. truth[24]="If you could be an animal, what would you be?"
  68. truth[25]="Who is your favourite staff?(Admin/Moderator/Sentinels/Mapcrew/Funcorp)"
  69. truth[26]="What is your impression of me? Do you like me?"
  70. truth[27]="Have you ever cheated on any test?"
  71. truth[28]="How many boyfriends/girlfriends have you had?"
  72. truth[29]="If you were a billionaire, what would you spend your time doing?"
  73. truth[30]="If you could be a boss of a company one day, what would you do?"
  74. truth[31]="What celebrity are you obsessed with?"
  75. truth[32]="What is your favourite sports team/player?"
  76. truth[32]="What is your favourite song that is out right now?"
  77. 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)"
  78. 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)"
  79. truth[35]="Would rather be rich but dumb, or poor but clever?"
  80. truth[36]="If you are driving and your break does not work, and you could either turn left and kill one young lady, or do nothing and kill 3 old people, what would you do?"
  81. truth[37]="Do you like anyone beside your soulmate? If yes, who?"
  82. 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?? "
  83.  
  84. dare={}--you can follow the format 'dare[number]="Dare"'
  85. dare[1]="I dare you go into EN/EN2 room 2 and spam this message 3 times: CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE"
  86. dare[2]="I dare you whisper a moderator a swear word."
  87. dare[3]="I dare you tell your crush, or anybody in this room that you love him/her right now"
  88. dare[4]="I dare you go into EN/EN2 room 1 and spam this message 3 times: I'M FLOODING REPORT ME!"
  89. dare[5]="I dare you report a moderator for hacking"
  90. 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!"
  91. dare[7]="I dare you tell your real life name to everybody in chat"
  92. dare[8]="I dare you take a picture of your real life face and send it to everyone to see."
  93. dare[9]="I dare you go into any #utility room with at least 3 people in it and crash the room."
  94. dare[10]="I dare you give me, the questioner, every ball you have in your inventory, if you have any."
  95. dare[11]="I dare you to disconnect and reconnect right now."
  96. dare[12]="I dare you to say who would be your most likely crush among the players in this room we are in."
  97. dare[13]="I dare you to give all your selfies to me right now, if you have any balls to do it via trade"
  98. dare[14]="I dare you complete this map without cheating!"
  99. dare[15]="I dare you whisper 'I LOVE YOU (username)' 30 times to a username in room/tribe in room chat or in tribe chat."
  100. dare[16]="I dare you kiss me, the questioner, 20 times :)"
  101. dare[17]="I dare you marry your closest friend, if u are not already married"
  102. dare[18]="I dare you give me, the questioner, every snowball you have in your inventory, if you have any."
  103. dare[19]="I dare you whisper a moderator, 'Ban me!'"
  104. dare[20]="I dare you kiss and hug someone in the room of the same gender"
  105. dare[21]="I dare you spam 'I AM A DUMB COWARD!' 10 times in this room's chat"
  106. dare[22]="I dare you ask your crush for a date."
  107. dare[23]="I dare you spam to a moderator, 'HEY <moderator's name>, I'M DAD'"
  108. dare[24]="I dare you go to a room in EN/EN2 and type 'I WANT WAFFLES' 3 times."
  109. dare[25]="I dare you go to cafe and create a topic: 'I LOVE UNDERTALE'"
  110. 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!!! *-*'"
  111.  
  112. function admining(name)
  113. _,_,suffix=string.find((tfm.get.room.name:sub(1,2)=="e2" and tfm.get.room.name:sub(3)) or tfm.get.room.name,"%d+(.+)$")
  114. local roomSuffix = string.match(tfm.get.room.name, "%d+(.-)$")
  115. if (roomSuffix and string.lower(name) == string.lower(roomSuffix)) or (string.byte(tfm.get.room.name,2)==3 and (tfm.get.room.name:lower()):match(tfm.get.room.playerList[name].tribeName:lower())) then
  116. return true
  117. elseif suffix and ((suffix:lower()):match(name:lower()) or (suffix:lower()):match(tfm.get.room.playerList[name].tribeName:lower())) then
  118. return true
  119. end
  120. for _,v in pairs(permadmins) do
  121. if string.lower(v) == string.lower(name) then
  122. return true
  123. end
  124. end
  125. return false
  126. end
  127.  
  128. function eventNewPlayer(name)
  129. tfm.exec.addImage("1548ed5434f.jpg","?3",0,-25)
  130. tfm.exec.bindKeyboard(name,0,true,true)
  131. tfm.exec.bindKeyboard(name,2,true,true)
  132.  
  133. tat=0
  134. 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)
  135. tfm.exec.chatMessage("<font color='#2ECF73'>Welcome to Truth or Dare Game! Type <font color='#FFFFFF'>!help</font> for more information of the game and <font color='#FFFFFF'>!commands</font> to see the list of commands. \nForum Thread: atelier801.com//topic?f=6&t=814350&p=1 \n<font color='#00FF00'><b>Created by Tat#0095</b></font></font>",name)
  136. tfm.exec.chatMessage("<b><font color='#BABD2F'>Type !join to join the game.</font></b>",name)
  137. 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 Tat#0095</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)
  138. p[name]={questioners=false, admin=admining(name), spectator=true, ban=false, randomerino=1, out=false, new=false, id=5, cheese=false, victor=false}
  139. end
  140.  
  141. for name,player in pairs(tfm.get.room.playerList) do
  142. eventNewPlayer(name)
  143. end
  144.  
  145.  
  146.  
  147. function eventKeyboard(name,key,down,x,y)
  148. if key==0 and down==true and p[name].cheese==false and p[name].victor==false then
  149. tfm.exec.removeImage(p[name].id)
  150. p[name].id=tfm.exec.addImage("155865bc675.png","%"..name,-30,-40)
  151. end
  152. if key==2 and down==true and p[name].cheese==false and p[name].victor==false then
  153. tfm.exec.removeImage(p[name].id)
  154. p[name].id=tfm.exec.addImage("155865a7b4b.png","%"..name,-30,-40)
  155. end
  156. if key==0 and down==true and p[name].cheese==true and p[name].victor==false then
  157. tfm.exec.removeImage(p[name].id)
  158. --print(p[name].id)
  159. p[name].id=tfm.exec.addImage("155865fb4e8.png","%"..name,-25,-35)
  160. end
  161. if key==2 and down==true and p[name].cheese==true and p[name].victor==false then
  162. tfm.exec.removeImage(p[name].id)
  163. --print(p[name].id)
  164. p[name].id=tfm.exec.addImage("155865f9b10.png","%"..name,-20,-35)
  165. end
  166. if key==0 and down==true and p[name].victor==true then
  167. tfm.exec.removeImage(p[name].id)
  168. --print(p[name].id)
  169. p[name].id=tfm.exec.addImage("155865e2170.png","%"..name,-20,-25)
  170. end
  171. if key==2 and down==true and p[name].victor==true then
  172. tfm.exec.removeImage(p[name].id)
  173. --print(p[name].id)
  174. p[name].id=tfm.exec.addImage("155865e09bf.png","%"..name,-20,-25)
  175. end
  176. end
  177.  
  178. function eventPlayerGetCheese(name)
  179. p[name].cheese=true
  180. tfm.exec.removeImage(p[name].id)
  181. end
  182.  
  183.  
  184. function eventNewGame()
  185. tfm.exec.addImage("1548ed5434f.jpg","?3",0,-25)
  186. for name,player in pairs(tfm.get.room.playerList) do
  187. p[name].cheese=false
  188. tfm.exec.removeImage(p[name].id)
  189. end
  190. 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)
  191. 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 Tat#0095</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)
  192. answerer=""
  193. questioner=""
  194. begin=false
  195. start=true
  196. numplayers=0
  197. count=1
  198. one=false
  199. tat=0
  200. for name,player in pairs(tfm.get.room.playerList) do
  201. p[name]={questioners=false, admin=admining(name), spectator=true, ban=false, randomerino=1, out=false, new=false, id=5, cheese=false, victor=false}
  202. players[count]=name
  203. timestamp=os.time()
  204. numplayers=numplayers+1
  205. count=count+1
  206. p[name].spectator=false
  207. p[name].questioners=false
  208. end
  209. system.disableChatCommandDisplay("t", hidden)
  210. system.disableChatCommandDisplay("admin", hidden)
  211. system.disableChatCommandDisplay("restart", hidden)
  212. system.disableChatCommandDisplay("ban", hidden)
  213. system.disableChatCommandDisplay("skip", hidden)
  214. system.disableChatCommandDisplay("watch", hidden)
  215. system.disableChatCommandDisplay("unban", hidden)
  216. system.disableChatCommandDisplay("unadmin", hidden)
  217. system.disableChatCommandDisplay("mods", hidden)
  218. system.disableChatCommandDisplay("help", hidden)
  219. system.disableChatCommandDisplay("commands", hidden)
  220. end
  221.  
  222. function eventChatCommand(name,command)
  223. local IDList = {}
  224. if command=="clear" then
  225. for id, object in pairs(tfm.get.room.objectList) do
  226. table.insert(IDList, id)
  227. end
  228. for i, id in pairs(IDList) do
  229. tfm.exec.removeObject(id)
  230. end
  231. end
  232. if command=="s" and p[name].admin==true then
  233. if string.sub(command,3)=="" then
  234. tfm.exec.setShaman(name)
  235. else
  236. tfm.exec.setShaman(string.sub(command,3))
  237. end
  238. elseif command=="dance" and p[name].admin==true then
  239. for name,player in pairs(tfm.get.room.playerList) do
  240. p[name].randomerino=math.random(1,4)
  241. end
  242. dance=true
  243. elseif command=="danceoff" and p[name].admin==true then
  244. dance=false
  245. elseif command=="mods" then
  246. message=""
  247. for k,v in pairs(tfm.get.room.playerList) do
  248. if p[k].admin==true then
  249. message=message..tostring(k)..", "
  250. end
  251. end
  252. tfm.exec.chatMessage("<font color='#FF69B4'>The Truth/Dare moderators are: "..string.sub(message,1,-3)..".</font>", name)
  253. elseif command=="new" and name==questioner then
  254. if p[name].new==false then
  255. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  256. answererold=answerer
  257. answerer=""
  258. choose=true
  259. p[name].new=true
  260. else
  261. ui.updateTextArea(1, "<p align='center'><b><font size='30'>You can only !new ONCE</font></b></p>", nil)
  262. end
  263. elseif command=="join" and p[name].spectator==true then
  264. if p[name].ban==false then
  265. ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..name.." joined the game! :D</font></b></p>", nil)
  266. tfm.exec.chatMessage("<b><font color='#BABD2F'>You have joined the game.</font></b>", name)
  267. tfm.exec.respawnPlayer(name)
  268. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  269. p[name].spectator=false
  270. table.insert(players,name)
  271. elseif p[name].ban==true then
  272. tfm.exec.chatMessage("<b><font color='#BABD2F'>You have been banned, so u cannot join the game :(</font></b>", name)
  273. end
  274. elseif command=="skip" and p[name].admin==true then
  275. timestamp=os.time()
  276. tfm.exec.chatMessage("<font color='#FF69B4'>"..questioner.."'s turn has been skipped by Truth/Dare Moderation.</font>",nil)
  277. skip=true
  278. elseif string.sub(command,0,1) == "t" and p[name].admin==true then
  279. message=string.sub(command,3)
  280. tfm.exec.chatMessage("<font color='#FF69B4'>[~Truth/Dare Moderation] "..message.."</font>", nil)
  281. elseif command=="restart" and p[name].admin==true then
  282. tfm.exec.newGame("@6411544")
  283. elseif string.sub(command,0,5)=="watch" then
  284. if string.sub(command,7)=="" then
  285. p[name].spectator=true
  286. ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..name.." is now a spectator :(</font></b></p>", nil)
  287. tfm.exec.chatMessage("<b><font color='#BABD2F'>Type !join to join the game.</font></b>",name)
  288. if name==questioner or name==answerer then
  289. questioner=""
  290. answerer=""
  291. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  292. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  293. timestamp=os.time()
  294. skip=true
  295. end
  296. for i=1,#players do
  297. if players[i]==name then
  298. table.remove(players,i)
  299. end
  300. end
  301. else
  302. if p[name].admin==true then
  303. message=string.sub(command,7)
  304. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  305. for k,v in pairs(tfm.get.room.playerList) do
  306. if k==message and p[k].spectator==false then
  307. if k==questioner or k==answerer then
  308. skip=true
  309. timestamp=os.time()
  310. end
  311. p[k].spectator=true
  312. ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..k.." is now a spectator :(</font></b></p>", nil)
  313. tfm.exec.chatMessage("<b><font color='#BABD2F'>Type !join to join the game.</font></b>",name)
  314. for i=1,#players do
  315. if players[i]==k then
  316. table.remove(players,i)
  317. end
  318. end
  319. end
  320. end
  321. end
  322. end
  323. elseif command=="help" then
  324. 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 Tat#0095</font> \n</font><font face='impact' size='30'>Type !commands to see the list of commands</font>",name,100,50,600,true)
  325. elseif command=="commands" then
  326. if p[name].admin==true then
  327. 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)
  328. elseif p[name].admin==false then
  329. 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)
  330. end
  331. elseif string.sub(command,0,3)=="ban" and p[name].admin==true then
  332. local c=0
  333. local reason=""
  334. if string.find(command," ",5)==nil then
  335. message=string.sub(command,5)
  336. else
  337. c=string.find(command," ",5)
  338. message=string.sub(command,5,c-1)
  339. reason=string.sub(command,c+1)
  340. end
  341. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  342. for k,v in pairs(tfm.get.room.playerList) do
  343. if message==k then
  344. tfm.exec.chatMessage("<font color='#FF69B4'>[~Truth/Dare Moderation] "..message.." has been banned for 9999 hours. Reason: "..reason.."</font>", nil)
  345. p[message].ban=true
  346. tfm.exec.killPlayer(k)
  347. for i=1,#players do
  348. if players[i]==k then
  349. table.remove(players,i)
  350. end
  351. end
  352. end
  353. end
  354. elseif string.sub(command,0,5)=="unban" and p[name].admin==true then
  355. message=string.sub(command,7)
  356. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  357. for k,v in pairs(tfm.get.room.playerList) do
  358. if message==k then
  359. tfm.exec.chatMessage("<font color='#FF69B4'>[~Truth/Dare Moderation] "..message.." has been unbanned.</font>", nil)
  360. p[message].ban=false
  361. tfm.exec.respawnPlayer(k)
  362. table.insert(players,k)
  363. end
  364. end
  365. elseif string.sub(command,0,5)=="admin" and p[name].admin==true then
  366. message=string.sub(command,7)
  367. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  368. for k,v in pairs(tfm.get.room.playerList) do
  369. if message==k then
  370. tfm.exec.chatMessage("<font color='#FF69B4'>[~Truth/Dare Moderation] "..message.." is now a Truth/Dare moderator. Congrats!</font>", nil)
  371. p[message].admin=true
  372. end
  373. end
  374. elseif string.sub(command,0,7)=="unadmin" and p[name].admin==true then
  375. message=string.sub(command,9)
  376. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  377. for k,v in pairs(tfm.get.room.playerList) do
  378. if message==k then
  379. tfm.exec.chatMessage("<font color='#FF69B4'>[~Truth/Dare Moderation] "..message.." is demoded. What a waste!</font>", nil)
  380. p[message].admin=false
  381. end
  382. end
  383. end
  384. end
  385. function eventLoop(time,remaining)
  386. if dance==true then
  387. for name,player in pairs(tfm.get.room.playerList) do
  388. if p[name].randomerino==1 then
  389. tfm.exec.playEmote(name,0,nil)
  390. p[name].randomerino=math.random(1,4)
  391. elseif p[name].randomerino==2 then
  392. tfm.exec.playEmote(name,15,nil)
  393. p[name].randomerino=math.random(1,4)
  394. elseif p[name].randomerino==3 then
  395. tfm.exec.playEmote(name,16,nil)
  396. p[name].randomerino=math.random(1,4)
  397. elseif p[name].randomerino==4 then
  398. tfm.exec.playEmote(name,24,nil)
  399. p[name].randomerino=math.random(1,4)
  400. end
  401. end
  402. end
  403. numplayers=#players
  404. for k,v in pairs(tfm.get.room.playerList) do
  405. if p[k].ban==true then
  406. ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>You have been banned. :(</font></p></b>",k)
  407. elseif p[k].spectator==true then
  408. ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",k)
  409. end
  410. end
  411. local IDList={}
  412. for id, object in pairs(tfm.get.room.objectList) do
  413. table.insert(IDList, id)
  414. end
  415. for i, id in pairs(IDList) do
  416. if others[id].summonobject==true and timestamplol[id]<os.time()-3000 then
  417. tfm.exec.removeObject(id)
  418. others[id].summonobject=false
  419. end
  420. end
  421. if numplayers<2 then
  422. one=true
  423. else
  424. one=false
  425. end
  426. if one==true then
  427. 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)
  428. timestamp=os.time()-4000
  429. elseif timestamp < os.time()-10000 and begin==false then
  430. timestamp=os.time()
  431. begin=true
  432. restart=false
  433. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Let's Begin the Game! </font></b></p>", nil)
  434. for name,player in pairs(tfm.get.room.playerList) do
  435. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  436. end
  437. elseif timestamp < os.time()-5000 and begin==false then
  438. local i=1
  439. local long=""
  440. local hname=""
  441. while i<=numplayers do
  442. hname=players[i]
  443. if p[hname].spectator==false and tfm.get.room.playerList[hname].isDead==false and p[hname].out==false then
  444. long=long..tostring(players[i])..", "
  445. end
  446. i=i+1
  447. end
  448. ui.updateTextArea(1, "<p align='center'><b><font size='15'>The participating players are: "..string.sub(long,1,-3)..".</font></b></p>", nil)
  449. elseif timestamp < os.time()-3000 and begin==false and restart==true then
  450. ui.updateTextArea(1, "<p align='center'><b><font size='20'>Since everyone had their turn, I'll restart the game...", nil)
  451. end
  452. if begin==true then
  453. if timestamp < os.time()-3000 and start==true then
  454. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  455. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  456. answerer=""
  457. questioner=""
  458. local j=1
  459. local i=0
  460. while j<=numplayers do
  461. pname=players[j]
  462. if p[pname].questioners==false and tfm.get.room.playerList[pname].isDead==false and p[pname].spectator==false and p[pname].out==false then
  463. i=i+1
  464. end
  465. j=j+1
  466. end
  467. if i>0 then
  468. eventTruthOrDare()
  469. else
  470. local j=1
  471. while j<=numplayers do
  472. local name=players[j]
  473. p[name].questioners=false
  474. j=j+1
  475. end
  476. restart=true
  477. timestamp=os.time()
  478. begin=false
  479. end
  480. end
  481. if choose==true and one==false then
  482. rand=math.random(1,numplayers)
  483. answerer=players[rand]
  484. if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or answerer==answererold or p[answerer].out==true then
  485. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  486. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  487. answerer=""
  488. else
  489. choose=false
  490. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick truth or dare...</font></b>", nil)
  491. ui.addPopup(3,1,"You are the answerer! Do you want Truth? If No, you will choose Dare!",answerer,250,50,300,true)
  492. end
  493. elseif choosey==true and one==false then
  494. rand=math.random(1,numplayers)
  495. questioner=players[rand]
  496. if p[questioner].questioners==false and tfm.get.room.playerList[questioner].isDead==false and p[questioner].spectator==false or p[questioner].out==false then
  497. choosey=false
  498. p[questioner].questioners=true
  499. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is now the asker! Waiting to pick an answerer...</font></b>", nil)
  500. 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)
  501. else
  502. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  503. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  504. questioner=""
  505. end
  506. end
  507. if skip==true then
  508. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Skipping turn...</font></b></p>", nil)
  509. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  510. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  511. answerer=""
  512. questioner=""
  513. if timestamp < os.time()-3000 then
  514. start=true
  515. skip=false
  516. end
  517. end
  518. tfm.exec.movePlayer(questioner,120,120,false,0,0,false)
  519. tfm.exec.movePlayer(answerer,680,120,false,0,0,false)
  520. end
  521. end
  522.  
  523. function eventTruthOrDare()
  524. start=false
  525. ui.removeTextArea(2)
  526. ui.removeTextArea(3)
  527. choosey=true
  528. end
  529.  
  530. function eventPopupAnswer(id, name, answer)
  531. if id==1 and name==questioner then
  532. if answer=="yes" then
  533. answererold=""
  534. choose=true
  535. elseif answer=="no" then
  536. ui.addPopup(2,2,"Who do you want to be the answerer?",questioner,250,50,300,true)
  537. end
  538. elseif id==2 and name==questioner then
  539. x=1
  540. found=false
  541. answer=string.upper(string.sub(answer,0,1))..string.sub(answer,2)
  542. answer=string.gsub(answer, "<", "&lt;")
  543. answer=string.gsub(answer, "http", "")
  544. answer=string.gsub(answer,"fuck", "****")
  545. answer=string.gsub(answer,"shit", "****")
  546. answer=string.gsub(answer,"ass", "***")
  547. answer=string.gsub(answer,"cunt", "****")
  548. answer=string.gsub(answer,"dick", "****")
  549. while x<=numplayers do
  550. if answer==players[x] then
  551. answerer=answer
  552. if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or p[answerer].out==true then
  553. answerer=""
  554. found=false
  555. else
  556. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick Truth or Dare...</font></b>", nil)
  557. 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)
  558. found=true
  559. end
  560. end
  561. x=x+1
  562. end
  563. if found==false then
  564. 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)
  565. end
  566. elseif id==3 and name==answerer then
  567. if answer=="yes" then
  568. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has picked Truth! Waiting for question from "..questioner.."...</font></b>", nil)
  569. 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)
  570. elseif answer=="no" then
  571. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has picked Dare! Waiting for a dare from "..questioner.."...</font></b>", nil)
  572. 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)
  573.  
  574. end
  575. elseif id==4 and name==questioner then
  576. if answer=="yes" then
  577. question=truth[math.random(1,#truth)]
  578. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)
  579. ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  580. ui.addPopup(8,2,"<b>Type your Truth answer below</b>",answerer,250,175,300,true)
  581.  
  582. elseif answer=="no" then
  583. 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)
  584. end
  585. elseif id==5 and name==questioner then
  586. if answer=="yes" then
  587. question=dare[math.random(1,#dare)]
  588. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  589. ui.addTextArea(2,"<b><font size='20'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  590. 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)
  591. elseif answer=="no" then
  592. ui.addPopup(7,2,"Type your Dare below, or type #(number) for the dare number from the random list.",questioner,250,50,300,true)
  593. end
  594. elseif id==6 and name==questioner then
  595. answer=string.gsub(answer, "<", "&lt;")
  596. answer=string.gsub(answer, "http", "")
  597. answer=string.gsub(answer,"fuck", "****")
  598. answer=string.gsub(answer,"shit", "****")
  599. answer=string.gsub(answer,"ass", "***")
  600. answer=string.gsub(answer,"cunt", "****")
  601. answer=string.gsub(answer,"dick", "****")
  602. if answer=="" then
  603. ui.addPopup(6,2,"You have to type something as your Truth question.",questioner,250,50,300,true)
  604. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))<=#truth then
  605. question=truth[tonumber(string.sub(answer,2,3))]
  606. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)
  607. ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  608. ui.addPopup(8,2,"Type your Truth answer below",answerer,250,175,300,true)
  609. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))>#truth then
  610. ui.addPopup(6,2,"You have to type a Truth question number less than or equal to "..tostring(#truth),questioner,250,50,300,true)
  611. else
  612. question=answer
  613. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)
  614. ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  615. ui.addPopup(8,2,"Type your Truth answer below",answerer,250,175,300,true)
  616. end
  617. elseif id==7 and name==questioner then
  618. answer=string.gsub(answer, "<", "&lt;")
  619. answer=string.gsub(answer, "http", "")
  620. answer=string.gsub(answer,"fuck", "****")
  621. answer=string.gsub(answer,"shit", "****")
  622. answer=string.gsub(answer,"ass", "***")
  623. answer=string.gsub(answer,"cunt", "****")
  624. answer=string.gsub(answer,"dick", "****")
  625. if answer=="" then
  626. ui.addPopup(7,2,"You have to type something as your Dare.",questioner,250,50,300,true)
  627. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))<=#dare then
  628. if tonumber(string.sub(answer,2,3))==14 then
  629. mapcomplete=true
  630. end
  631. question=dare[tonumber(string.sub(answer,2,3))]
  632. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  633. ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  634. 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)
  635. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))>#dare then
  636. ui.addPopup(7,2,"You have to type a Dare number less than or equal to "..tostring(#dare),questioner,250,50,300,true)
  637. else
  638. question=answer
  639. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  640. ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  641. 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)
  642. end
  643. elseif id==8 and name==answerer then
  644. answer=string.gsub(answer, "<", "&lt;")
  645. answer=string.gsub(answer, "http", "")
  646. answer=string.gsub(answer,"fuck", "****")
  647. answer=string.gsub(answer,"shit", "****")
  648. answer=string.gsub(answer,"ass", "***")
  649. answer=string.gsub(answer,"cunt", "****")
  650. answer=string.gsub(answer,"dick", "****")
  651. ans = answer
  652. if ans=="" then
  653. ui.addPopup(8,2,"You have to type something as your Truth Answer",answerer,250,175,300,true)
  654. else
  655. ui.addTextArea(3,"<b><font size='20'>Answer: "..ans.."</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  656. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." has answered the question! Waiting for "..questioner.." to rate the answer</font></b>", nil)
  657. ui.addPopup(10,1,"<b><font size='15'>Are you satisfied with the answer?",questioner,250,50,300,true)
  658. end
  659. elseif id==9 and name==answerer then
  660. if answer=="yes" then
  661. 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)
  662. if mapcomplete==true then
  663. 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)
  664. p[answerer].out=true
  665. mapcomplete=false
  666. for i=1,#players do
  667. if players[i]==answerer then
  668. table.remove(players,i)
  669. end
  670. end
  671. else
  672. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a warrior! Starting new game...</font></b>", nil)
  673. end
  674. timestamp=os.time()
  675. answerer=""
  676. questioner=""
  677. start=true
  678. for name,player in pairs(tfm.get.room.playerList) do
  679. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  680. p[name].new=false
  681. end
  682. elseif answer=="no" then
  683. mapcomplete=false
  684. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is a coward! Starting new game...</font></b>", nil)
  685. 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)
  686. timestamp=os.time()
  687. answerer=""
  688. questioner=""
  689. start=true
  690. for name,player in pairs(tfm.get.room.playerList) do
  691. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  692. p[name].new=false
  693. end
  694. end
  695. elseif id==10 and name==questioner then
  696. if answer=="yes" then
  697. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a satisfied with the answer! Starting new game...</font></b>", nil)
  698. timestamp=os.time()
  699. answerer=""
  700. questioner=""
  701. start=true
  702. for name,player in pairs(tfm.get.room.playerList) do
  703. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  704. p[name].new=false
  705. end
  706. elseif answer=="no" then
  707. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a not satisfied with the answer...:( Starting new game...</font></b>", nil)
  708. timestamp=os.time()
  709. answerer=""
  710. questioner=""
  711. start=true
  712. for name,player in pairs(tfm.get.room.playerList) do
  713. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  714. p[name].new=false
  715. end
  716. end
  717. end
  718. end
  719.  
  720. function eventPlayerLeft(name)
  721. ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..name.." left the room... What a coward!</font></b></p>", nil)
  722. if questioner==name or answerer==name then
  723. timestamp=os.time()
  724. skip=true
  725. end
  726. for i=1,#players do
  727. if players[i]==name then
  728. table.remove(players,i)
  729. end
  730. end
  731. end
  732.  
  733. function eventPlayerDied(name)
  734. if p[name].spectator==false and p[name].ban==false then
  735. tfm.exec.respawnPlayer(name)
  736. end
  737. if p[name].ban==true then
  738. if name==questioner or name==answerer then
  739. timestamp=os.time()
  740. skip=true
  741. end
  742. end
  743. end
  744.  
  745. function eventPlayerWon(playerName,timeElapsed, timeElapsedSinceRespawn)
  746. p[playerName].cheese=false
  747. p[playerName].victor=true
  748. tfm.exec.respawnPlayer(playerName)
  749. if p[playerName].out==true then
  750. p[playerName].out=false
  751. table.insert(players,playerName)
  752. tfm.exec.chatMessage("<font color='#BABD2F'>"..playerName.." completed the map in "..(timeElapsedSinceRespawn/100).." seconds! He/she has joined back the game!</font>", nil)
  753. else
  754. tfm.exec.chatMessage("<font color='#BABD2F'>"..playerName.." completed the map in "..(timeElapsedSinceRespawn/100).." seconds!</font>", nil)
  755. end
  756. end
  757.  
  758. function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, other)
  759. timestamplol[other.id]=os.time()
  760. others[other.id]={summonobject=true}
  761. end
Advertisement
Add Comment
Please, Sign In to add comment