Advertisement
HunYan

[Mice Against Humanity]

May 6th, 2017
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 28.45 KB | None | 0 0
  1. admins = { Heniyengui = true }
  2.  
  3. maxPlayers = 5      -- Max 9 Players.
  4.  
  5.  
  6. move = false        -- If true, All the text areas (The cards) will stay relative to the UI on scrolling maps,
  7.                     -- so if you move the text area will follow you.
  8.                     -- If false, all the text areas will stay in the same position on the map.
  9.  
  10.                    
  11. repeatCards = true  -- If true, Green Cards will repeat every round.
  12.                     -- So you may get the same card this round and the next rounds.
  13.                     -- If false, Green Cards will repeat every new game. (This is like discarding them every round)
  14.                     -- Note: If there isn't enough Green Cards and this is set to false the game will crash.
  15.                    
  16. -----------------------------------------------------------------------------------------------
  17.  
  18. greenCard={}--You can add new cards by following this:   greenCard[number]="Green Card Text Here"
  19. greenCard[1]="Whips"
  20. greenCard[2]="Helping yourself"
  21. greenCard[3]="Big hair"
  22. greenCard[4]="Barack Obama"
  23. greenCard[5]="Donald Trump"
  24. greenCard[6]="Hillary Clinton"
  25. greenCard[7]="Coming soon"
  26. greenCard[8]="Global warming"
  27. greenCard[9]="Passion Fruit"
  28. greenCard[10]="Prescription Drugs"
  29. greenCard[11]="Crabs"
  30. greenCard[12]="Something frilly"
  31. greenCard[13]="Beating a dead shaman"
  32. greenCard[14]="Heavy breathing"
  33. greenCard[15]="shippings <3"
  34. greenCard[16]="A burning sensation in an awkward place"
  35. greenCard[17]="Something fishy"
  36. greenCard[18]="Evil laughter"
  37. greenCard[19]="A coming out party"
  38. greenCard[20]="The 1%"
  39. greenCard[21]="Love is love"
  40. greenCard[22]="One of those trashy show about redneck women"
  41. greenCard[23]="Farting in public"
  42. greenCard[24]="Sir Lancelot"
  43. greenCard[25]="Mario and Princess Peach"
  44. greenCard[26]="Sonic the hedgehog"
  45. greenCard[27]="Black Butler"
  46. greenCard[28]="Anime"
  47. greenCard[29]="Magic fingers"
  48. greenCard[30]="Sucking at everything"
  49. greenCard[31]="A bomb shell"
  50. greenCard[31]="The root of all evil"
  51. greenCard[32]="Long John Silvers"
  52. greenCard[33]="Oddly shaped feet"
  53. greenCard[34]="A cracker"
  54. greenCard[35]="Swearing in sign language"
  55. greenCard[36]="The death penalty"
  56. greenCard[37]="HUMP DAY!"
  57. greenCard[38]="Slip'n'Slides"
  58. greenCard[39]="Prom night"
  59. greenCard[40]="Tipping a port-a-potty with someone inside"
  60. greenCard[41]="Tongs"
  61. greenCard[42]="Im a queen"
  62. greenCard[43]="Twerking"
  63. greenCard[44]="Public nudity"
  64. greenCard[45]="Human sacrafices"
  65. greenCard[46]="None of your business"
  66. greenCard[47]="Toys"
  67. greenCard[48]="Hot co workers"
  68. greenCard[49]="A ken doll"
  69. greenCard[50]="Being sent to the penalty box"
  70. greenCard[51]="The unspoken language of love"
  71. greenCard[52]="Angel wing tattoos"
  72. greenCard[53]="A jar of vaseline"
  73. greenCard[54]="A peeping tom"
  74. greenCard[55]="breaking wind"
  75. greenCard[56]="Death by chocolate"
  76. greenCard[57]="My hot neighbor"
  77. greenCard[58]="Donald Trump's hair"
  78. greenCard[59]="Black magic"
  79. greenCard[60]="A racist family member"
  80. greenCard[61]="Victoria's Secret"
  81. greenCard[62]="The crack of dawn"
  82. greenCard[63]="Night moves"
  83. greenCard[64]="An animatronic snowman"
  84. greenCard[65]="Kim Jong-un"
  85. greenCard[66]="Fishnets"
  86. greenCard[67]="Affirmative Action"
  87. greenCard[68]="Deciding to become a professional wrestler"
  88. greenCard[69]="Acid"
  89. greenCard[70]="Flashbacks"
  90. greenCard[71]="A virgin"
  91. greenCard[72]="World religions"
  92. greenCard[73]="Artificial intelligence"
  93. greenCard[74]="Low impact aerobics"
  94. greenCard[75]="A naughty girl"
  95. greenCard[76]="The homeless"
  96. greenCard[77]="Poking a hole"
  97. greenCard[78]="Hanky-panky"
  98. greenCard[79]="Men in uniform"
  99. greenCard[80]="squishy things"
  100. greenCard[81]="America's sweetheart"
  101. greenCard[82]="A load of BS"
  102. greenCard[83]="Missionary"
  103. greenCard[84]="A little crack"
  104. greenCard[85]="Something stiff"
  105. greenCard[86]="Cold hard cash"
  106. greenCard[87]="Faking it"
  107. greenCard[88]="Play the race card"
  108. greenCard[89]="Waxing"
  109. greenCard[90]="Karma"
  110. greenCard[91]="Lesbians"
  111. greenCard[92]="The love canal"
  112. greenCard[93]="Taking it the wrong way"
  113. greenCard[94]="Seven deadly sins"
  114. greenCard[95]="Tooting your own horn"
  115. greenCard[96]="Grandma"
  116. greenCard[97]="Grandma's hair"
  117. greenCard[98]="A booger"
  118. greenCard[99]="Eating boogers"
  119. greenCard[100]="A used diaper I found on the side of the road."
  120.  
  121.  
  122.  
  123. purpleCard={}--You can add new cards by following this:   purpleCard[number]="Purple Card Text Here"
  124. purpleCard[1]="______ should be grounds for a national holiday."
  125. purpleCard[2]="Apply this medication three times a day to reduce _______."
  126. purpleCard[3]="I had a terrible nightmare about _____."
  127. purpleCard[4]="We go together like ______."
  128. purpleCard[5]="Oddly enough, I've developed a taste for _______"
  129. purpleCard[6]="In my life, theres always room for more _____"
  130. purpleCard[7]="The trouble of an unfinished sentence is _____"
  131. purpleCard[8]="Nothing sexier than _____"
  132. purpleCard[9]="Nothing is certain except _____"
  133. purpleCard[10]="All you need is ____"
  134. purpleCard[11]="I'd love to celebrate valentines day with ____"
  135. purpleCard[12]="If I could take something to a deserted island, I would take ___"
  136. purpleCard[13]="You know what annoys me? ____"
  137. purpleCard[14]="I use ____ in a way that would make you blush"
  138. purpleCard[15]="I used to get in trouble for playing with ____"
  139. purpleCard[16]="This place smells like ____"
  140. purpleCard[17]="I may forget a name, I may forget a face, but I will never forget ___"
  141. purpleCard[18]="according to the doctor I have a problem with ___"
  142. purpleCard[19]="What do I want for my birthday? My birthday suit and ___'"
  143. purpleCard[20]="I can't be friends with people who are interested in ____"
  144. purpleCard[21]="What do I rub for good luck?"
  145. purpleCard[22]="____ will make anyone seem more attractive"
  146. purpleCard[23]="When I roleplay I like to pretend I'm ____"
  147. purpleCard[24]="My guidance counselor told me I should focus on ____ as a career choice"
  148. purpleCard[25]="Am I the only one who hates ____"
  149. purpleCard[26]="My ex broke up with me because of my fondness for ____"
  150. purpleCard[27]="Everyone thinks im all about ___ and for the most part they're right"
  151. purpleCard[28]="What do you not want to find on your pizza?"
  152. purpleCard[29]="What would grandma find disturbing yet oddly charming?"
  153. purpleCard[30]="Introducing extreme vanilla! It's like vanilla but with ___"
  154. purpleCard[31]="Having tired of noobs and cheese, the immortal shamans now fill their days with ____."
  155. purpleCard[31]="What helps the Shaman relax?"
  156. purpleCard[32]="And in the end, the Shaman was not evil, he just wanted ___"
  157. purpleCard[33]="Life for mice forever changed when the Shaman introduced them to ____"
  158. purpleCard[34]="When I finally become mayor in transformice, I will create ___"
  159. purpleCard[35]="What is my guilty pleasure?"
  160. purpleCard[36]="I'm sorry Mice, I couldn't get you to the cheese because ___"
  161. purpleCard[37]="I get by with a little help from ___"
  162. purpleCard[38]="I'm going on a diet this week. Nothing but organic cheese and ____"
  163. purpleCard[39]="Why am I Shaman?"
  164. purpleCard[40]="What's my super power?"
  165. purpleCard[41]="What's that smell?"
  166. purpleCard[42]="I got 99 problems but ______ ain't one."
  167. purpleCard[43]="What's that sound?"
  168. purpleCard[44]="What ended my last relationship?"
  169. purpleCard[45]="I am sorry professor, but I couldn't complete my homework because of ______."
  170. purpleCard[46]="______. That's how I want to die."
  171. purpleCard[47]="What are my parents hiding from me?"
  172. purpleCard[48]="What gets better with age?"
  173. purpleCard[49]="What have I got in my pocket?"
  174. purpleCard[50]="My teacher kinda looks like ______, don't you think?"
  175. purpleCard[51]="What do old people smell like?"
  176. purpleCard[52]="I am not going to lie. I despise _____. There, I said it."
  177. purpleCard[53]="Cancel all my meetings. We've got a situation with _____ that requires my immediate attention."
  178. purpleCard[54]="All men must like _____."
  179. purpleCard[55]="_____ cuts deeper than swords."
  180. purpleCard[56]="My worst nightmare is meeting ______ face to face."
  181. purpleCard[57]="Lovin' you is easy 'cause you're ______."
  182. purpleCard[58]="This is the prime of my life. I'm young, hot and full of ______."
  183. purpleCard[59]="How did you spend your weekend?"
  184. purpleCard[60]="Maybe she's born with it. Maybe it's ______."
  185. purpleCard[61]="When you are going to a comic convention, always bring ______."
  186. purpleCard[62]="There is no sense crying over every mistake, you just keep on trying 'til you run out of ______."
  187. purpleCard[63]="I'm not racist or anything, but I really don't like _____."
  188. purpleCard[64]="I can't sleep at night because of ______."
  189.  
  190.  
  191.  
  192.  
  193. greencard={}
  194. purplecard={}
  195.  
  196. tfm.exec.disableAutoNewGame(true)
  197. tfm.exec.disableAfkDeath(true)
  198. tfm.exec.disableAutoShaman(true)
  199. tfm.exec.disableAutoScore(true)
  200. tfm.exec.disableAutoTimeLeft(true)
  201.  
  202. players = {}
  203. t = 0
  204. ban = {}
  205. maxPlayers2 = maxPlayers
  206. function banPlayer()
  207.     for name in pairs(tfm.get.room.playerList) do
  208.         if ban[name] then
  209.             tfm.exec.killPlayer(name)
  210.             for f = 500, 1500 do
  211.                 ui.removeTextArea(f , name)
  212.             end
  213.         end
  214.     end
  215. end
  216. function firstToUpper(str)
  217.     return (str:gsub("^%l", string.upper))
  218. end
  219. function eventNewPlayer(name)
  220.     banPlayer()
  221.     t = t + 1
  222.     players[name] = { vote = 0 , score = 0}
  223.     if not ban[name] then
  224.         tfm.exec.respawnPlayer(name)
  225.     end
  226.     tfm.exec.setPlayerScore(name,0,false)
  227.     ui.addPopup(0,0,"<p align = 'center'><font size='50' face='Agency FB'><b>Mice Against Humanity</b></font></p><font size='20' color='#CC0000'><b>About it</b></font><font size='13'>\nMice Against Humanity is an unofficial module. The game is supposed to be a cleaner version of the popular card game Cards Against Humanity. The purpose of the game is to get the most points by playing the card that the judger will think is the funniest! Every round, someone new will be the judger. The judger will play a purple card randomly, and everyone else must submit a green card. The judger will not know whos card is which until he/she picks the one they like the best. Everyone else though will be able to see whos card is who. There are currently "..#purpleCard.." Purple Cards and "..#greenCard.." Green Cards.</font>\n<font size='20' color='#CC0000'><b>Commands</b></font>\n<font size='13'><b>Type !commands to see the list of commands.</b>\n<font size='20' color='#CC0000'><b>Credits</b></font>\n<font size='15'>Created By <b>Heniyengui</b></font>\nThanks to Lavendier, Kierocheese and forum members for helping.</font>",name,50,20,700,true)
  228. end
  229. for name in pairs(tfm.get.room.playerList) do
  230.     eventNewPlayer(name)
  231. end
  232. if maxPlayers > 9 then
  233.     maxPlayers = 9
  234. end
  235.  
  236. function cardsText()
  237.  
  238. greencard = {}
  239. for k , v in pairs(greenCard) do
  240.     greencard[k] = v
  241. end
  242.  
  243. if finish then
  244.  
  245. purplecard = {}
  246. for k , v in pairs(purpleCard) do
  247.     purplecard[k] = v
  248. end
  249.  
  250. round = 0
  251. maxr = 7
  252.  
  253.  
  254. for name in pairs(tfm.get.room.playerList) do
  255.     tfm.exec.setPlayerScore(name,0,false)
  256.     players[name].score = 0
  257. end
  258.  
  259. tfm.exec.newGame("@7111582")
  260.  
  261. end
  262. end
  263. finish = true
  264. cardsText()
  265. function setJudger(name)
  266.     Judger = name
  267.     tfm.exec.killPlayer(name)
  268.     tfm.exec.respawnPlayer(name)
  269.     ui.addTextArea(0, "<p align = 'center'><font size='14'><b>"..name.." is the new judger.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  270.     local b = 0
  271.     for f in pairs(tfm.get.room.playerList) do
  272.         if players[f].vote == 1 then
  273.             b = b + 1
  274.             if b == maxPlayers and not chosen and not chosen2 then
  275.                 for c = 1, maxPlayers do
  276.                     ui.updateTextArea(ids[c] + 500,"<b><font size='12'>"..Player[c].."\n"..Idea[Player[c]].."</font></b>",nil)
  277.                     ui.updateTextArea(ids[c] + 500,"<b><font size='12'>\n<a href='event:"..Player[c].."'>"..Idea[Player[c]].."\n\n\n\n\n\n</a></font></b>",name)
  278.                 end
  279.             end
  280.         end
  281.     end
  282. end
  283. function eventNewGame()
  284.     maxPlayers = maxPlayers2
  285.     banPlayer()
  286.     if t > maxPlayers then
  287.         round = round + 1
  288.         if round == maxr then
  289.             ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Last Round</b></font>", nil, 8, 29, 240, 50, 0x324650, 0x000000, 0, move)
  290.         else
  291.             ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Round "..round.."</b></font>", nil, 8, 29, 240, 50, 0x324650, 0x000000, 0, move)
  292.         end
  293.         ui.addTextArea(1, "<p align = 'center'><b><font size='14' face='impact'>♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦</font></b></p>", nil, 301, 34, 200, 120, 0x952cd1, 0x212f36, 1, move)
  294.         ui.addTextArea(2, "<p align = 'center'><b><font size='25' face='impact'>Purple Card</font></b></p>", nil, 324, 76, 155, 35, 0x952cd1, 0x952cd1, 1, move)
  295.         i = 0
  296.         ui.addTextArea(0, "<p align = 'center'><font size='19'><b>Type !join to play. (Players : "..i.."/"..maxPlayers..")</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  297.     else
  298.         ui.addTextArea(0, "<p align = 'center'><font size='19'><b>".. maxPlayers + 1 .." Mice required to play the game!</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  299.     end
  300.  
  301. xx = 0
  302. getplace = {}
  303. y = 0
  304. start2 = false
  305. finish = false
  306. countdown = 2
  307. newround = 7
  308. ids = {}
  309. Judger = ""
  310. Judge = {}
  311. won = ""
  312. chosen = false
  313. chosen2 = false
  314. newgame2 = 13
  315. newgame = 5
  316. cards = {}
  317. Player = { }
  318.  
  319. Idea = {}
  320. end
  321.  
  322. function eventPlayerDied(name)
  323.     if not ban[name] then
  324.         tfm.exec.respawnPlayer(name)
  325.     end
  326. end
  327. function eventPlayerWon(name)
  328.     if not ban[name] then
  329.         tfm.exec.respawnPlayer(name)
  330.     end
  331. end
  332. function eventChatCommand(name, message)
  333.     if message == "join" and Player[name] == nil and t > maxPlayers and not ban[name] then
  334.         for q = 1 , maxPlayers + 1 do
  335.             if getplace[q] then
  336.                 Player[q] = name
  337.                 Player[name] = q
  338.                 getplace[q] = false
  339.                 if i < maxPlayers then
  340.                     i = i + 1
  341.                 else
  342.                     local x = 0
  343.                     for s = q + (4 *  (q - 1) ) , 5 * q do
  344.                         ui.addTextArea(s + 50 ,"<b><font size='13'><a href='event:card"..s.."'>"..cards[s].."\n\n\n\n\n\n</a></font></b>",Player[q],x + 30 , 255,138,80, 0x18700b, 0x000000, 1, move)
  345.                         x = x + 150
  346.                     end
  347.                 end
  348.             end
  349.             if q == maxPlayers + 1 and Player[name] == nil and i < maxPlayers then
  350.                 i = i + 1
  351.                 Player[name] = i
  352.                 Player[i] = name
  353.                 ui.addTextArea(0, "<p align = 'center'><font size='19'><b>Type !join to play. (Players : "..i.."/"..maxPlayers..")</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  354.             end
  355.         end
  356.     end
  357.     if i == maxPlayers then
  358.         startGame1()
  359.         i = i + 1
  360.     end
  361.     if message == "new" and admins[name] and i == maxPlayers + 1 and t > maxPlayers and not chosen and not chosen2 and not ban[name] then
  362.         setJudger(Judge[math.random(1 , #Judge)])
  363.     end
  364.     if message == "restart" and admins[name] and not ban[name] then
  365.         chosen2 = true
  366.         newgame2 = 0
  367.     end
  368.     if message == "mods" then
  369.         local mod = ""
  370.         for playermod in pairs(tfm.get.room.playerList) do
  371.             if admins[playermod] then
  372.                 mod = ""..mod..""..playermod..", "
  373.             end
  374.         end
  375.         ui.addPopup(0,0,"<b><font size='20' color='#00E4E7'>The admins are:</font>\n"..mod.."",name,100,50,600,true)
  376.     end
  377.     if message == "help" then
  378.         ui.addPopup(0,0,"<p align = 'center'><font size='50' face='Agency FB'><b>Mice Against Humanity</b></font></p><font size='20' color='#CC0000'><b>About it</b></font><font size='13'>\nMice Against Humanity is an unofficial module. The game is supposed to be a cleaner version of the popular card game Cards Against Humanity. The purpose of the game is to get the most points by playing the card that the judger will think is the funniest! Every round, someone new will be the judger. The judger will play a purple card randomly, and everyone else must submit a green card. The judger will not know whos card is which until he/she picks the one they like the best. Everyone else though will be able to see whos card is who. There are currently "..#purpleCard.." Purple Cards and "..#greenCard.." Green Cards.</font>\n<font size='20' color='#CC0000'><b>Commands</b></font>\n<font size='13'><b>Type !commands to see the list of commands.</b>\n<font size='20' color='#CC0000'><b>Credits</b></font>\n<font size='15'>Created By <b>Heniyengui</b></font>\nThanks to Lavendier, Kierocheese and forum members for helping.</font>",name,50,20,700,true)
  379.     end
  380.     if message == "commands" and not admins[name] then
  381.         ui.addPopup(0,0,"<b><font size='20' color='#00E4E7'>Commands:</font>\n!join to play. And also if a player leave, you can use this command to take his place.\n!mods to see the current admins in the room.\n!clear to clear all shaman objects.\n!help to see information about the game.",name,100,50,600,true)
  382.     end
  383.     if message == "commands" and admins[name] then
  384.         ui.addPopup(0,0,"<b><font size='20' color='#00E4E7'>Commands:</font>\n!join to play. And also if a player leave, you can use this command to take his place.\n!s to become shaman.\n!restart to restart the game.\n!new to set a random new judger.\n!judger (username) to make someone judger for this round.\n!ban (username) to not let someone play.\n!unban (username) to unban someone if he got banned.\n!admin (username) to make someone admin.\n!unadmin (admin name) to make an admin a normal player.\n!players (number) to set the number of mice that can play. (Max : 9)\n!setround (number) to change the number of the next round.\n!maxround (number) to change the number of total rounds (Last round number).\n!mods to see the current admins in the room.\n!clear to clear all shaman objects.\n!help to see information about the game.",name,100,50,600,true)
  385.     end
  386.     local IDList = {}
  387.     if message=="clear" and not ban[name] then
  388.         for id, object in pairs(tfm.get.room.objectList) do
  389.             table.insert(IDList, id)
  390.         end
  391.         for i, id in pairs(IDList) do
  392.             tfm.exec.removeObject(id)
  393.         end
  394.     end
  395.     if message == "s" and admins[name] and not ban[name] then
  396.         tfm.exec.setShaman(name)
  397.     end
  398.     local message_args = {}
  399.     for arg in message:gmatch("[^%s]+") do
  400.         table.insert(message_args, arg)
  401.     end
  402.     if message_args[2] ~= nil then
  403.         if message_args[1] == "ban" and admins[name] and not ban[name] then
  404.             message_args[2] = firstToUpper(message_args[2])
  405.             ban[message_args[2]] = true
  406.             admins[message_args[2]] = false
  407.             banPlayer()
  408.             ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..message_args[2].." has been banned! :(</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  409.             eventPlayerLeft(message_args[2])
  410.         end
  411.         if message_args[1] == "admin" and admins[name] and not ban[name] then
  412.             message_args[2] = firstToUpper(message_args[2])
  413.             ban[message_args[2]] = false
  414.             admins[message_args[2]] = true
  415.             ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..message_args[2].." is now a moderator!</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  416.         end
  417.         if message_args[1] == "unadmin" and admins[name] and not ban[name] then
  418.             message_args[2] = firstToUpper(message_args[2])
  419.             admins[message_args[2]] = false
  420.             ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..message_args[2].." is no longer a moderator! :(</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  421.         end
  422.         if message_args[1] == "unban" and admins[name] and not ban[name] then
  423.             t = t + 1
  424.             message_args[2] = firstToUpper(message_args[2])
  425.             ban[message_args[2]] = false
  426.             tfm.exec.respawnPlayer(message_args[2])
  427.             ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..message_args[2].." has been unbanned! :(</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  428.         end
  429.         if message_args[1] == "judger" and admins[name] and i == maxPlayers + 1 and t > maxPlayers and not ban[name] and not chosen and not chosen2 then
  430.             message_args[2] = firstToUpper(message_args[2])
  431.             if not ban[message_args[2]] then
  432.                 setJudger(message_args[2])
  433.             end
  434.         end
  435.         if message_args[1] == "players" and admins[name] and not ban[name] then
  436.             local number
  437.             for yy = 0, 9 do
  438.                 if tostring(yy) == message_args[2] then
  439.                     number = tonumber(message_args[2])
  440.                     if number > 1 and number <= 9 then
  441.                         maxPlayers2 = number
  442.                     end
  443.                 end
  444.             end
  445.         end
  446.         if message_args[1] == "setround" and admins[name] and not ban[name] then
  447.             local number
  448.             for yy = 0, 200 do
  449.                 if tostring(yy) == message_args[2] then
  450.                     number = tonumber(message_args[2])
  451.                     if number > 0 and number <= maxr then
  452.                         round = number - 1
  453.                     end
  454.                 end
  455.             end
  456.         end
  457.         if message_args[1] == "maxround" and admins[name] and not ban[name] then
  458.             local number
  459.             for yy = 0, 200 do
  460.                 if tostring(yy) == message_args[2] then
  461.                     number = tonumber(message_args[2])
  462.                     if number > round  then
  463.                         maxr = number
  464.                     end
  465.                 end
  466.             end
  467.         end
  468.     end
  469. end
  470. function startGame1()
  471.     if t > maxPlayers then
  472.         local j = 0
  473.         for name in pairs(tfm.get.room.playerList) do
  474.             players[name].vote = 0
  475.             if Player[name] == nil and not ban[name] then
  476.                 j = j + 1
  477.                 Judge[j] = name
  478.             end
  479.         end
  480.         Judger = Judge[math.random(1 , #Judge)]
  481.         tfm.exec.killPlayer(Judger)
  482.         tfm.exec.respawnPlayer(Judger)
  483.         ui.addTextArea(0, "<p align = 'center'><font size='14'><b>We got enough players... "..Judger.." will be judging this round. Waiting for players to choose a green card.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  484.         local e = math.random(1,#purplecard)
  485.         while purplecard[e] == "" do
  486.             e = math.random(1,#purplecard)
  487.         end
  488.         ui.addTextArea(1,"<b><font size='15'> "..purplecard[e].." </font></b>",  nil, 301, 34, 200, 120, 0x952cd1, 0x212f36, 1, move)
  489.         purplecard[e] = ""
  490.         ui.removeTextArea(2, nil)
  491.         for p = 1, maxPlayers do
  492.             local x = 0
  493.             for s = p + (4 *  (p - 1) ) , 5 * p do
  494.                 n = math.random(1,#greencard)
  495.                 while greencard[n] == "" do
  496.                     n = math.random(1,#greencard)
  497.                 end
  498.                 cards[s] = greencard[n]
  499.                 ui.addTextArea(s + 50 ,"<b><font size='13'><a href='event:card"..s.."'>"..cards[s].."\n\n\n\n\n\n</a></font></b>",Player[p],x + 30 , 255,138,80, 0x18700b, 0x000000, 1, move)
  500.                 x = x + 150
  501.                 greencard[n] = ""
  502.             end
  503.         end
  504.     end
  505. end
  506. function eventTextAreaCallback(id, name, cb)
  507.     if cb == "card"..(id - 50).."" and players[name].vote == 0 and not ban[name] then
  508.         Idea[name] = cards[id - 50]
  509.         ids[Player[name]] = id
  510.         ui.addTextArea(id + 500,"<p align='center'><b><font size='15'>Green</font>\n<font size='22'>Card</font></b></p>",nil,xx + 30 , y + 165,138,80, 0x18700b, 0x000000, 1, move)
  511.         xx = xx + 150
  512.         if xx == 750 then
  513.             xx = (-27)
  514.             y = ( -90 )
  515.         end
  516.         if y == -90 and xx == 273 then
  517.             xx = 480
  518.         end
  519.         players[name].vote = 1
  520.         local h = 0
  521.         for name in pairs(tfm.get.room.playerList) do
  522.             if players[name].vote == 1 then
  523.                 h = h + 1
  524.                 if h == maxPlayers then
  525.                     for a = 1, maxPlayers do
  526.                         ui.updateTextArea(ids[a] + 500,"<b><font size='12'>"..Player[a].."\n"..Idea[Player[a]].."</font></b>",nil)
  527.                         ui.updateTextArea(ids[a] + 500,"<b><font size='12'>\n<a href='event:"..Player[a].."'>"..Idea[Player[a]].."\n\n\n\n\n\n</a></font></b>",Judger)
  528.                     end
  529.                     ui.addTextArea(0, "<p align = 'center'><font size='17'><b>All the players chose a green card. Waiting for "..Judger.." to choose the funniest one.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  530.                     start2 = true
  531.                 end
  532.             end
  533.         end
  534.         ui.removeTextArea(id, nil)
  535.     end
  536.     if start2 then
  537.         for winner in pairs(tfm.get.room.playerList) do
  538.             if cb==winner and name == Judger and not chosen and not chosen2 then
  539.                 won = winner
  540.                 if round == maxr then
  541.                     ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..winner.." won this round. And the full game winner is...</font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  542.                     ui.updateTextArea(ids[Player[winner]] + 500,"<b><font size='12' color='#ff0000'>"..winner.."\n"..Idea[winner].."</font></b>",nil)
  543.                     tfm.exec.setPlayerScore(winner,10,true)
  544.                     players[winner].score = players[winner].score + 1
  545.                     chosen2 = true
  546.                 else
  547.                     ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..winner.." Won. Starting new round...</font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  548.                     ui.updateTextArea(ids[Player[winner]] + 500,"<b><font size='12' color='#ff0000'>"..winner.."\n"..Idea[winner].."</font></b>",nil)
  549.                     tfm.exec.setPlayerScore(winner,10,true)
  550.                     players[winner].score = players[winner].score + 1
  551.                     chosen = true
  552.                 end
  553.             end
  554.         end
  555.     end
  556. end
  557. function eventLoop()
  558.     for name in pairs(tfm.get.room.playerList) do
  559.         if ban[name] then
  560.             ui.addTextArea(0, "<p align = 'center'><font size='19'><b>You have been banned! :(</b></font></p>", name, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  561.         end
  562.     end
  563.     if t <= maxPlayers then
  564.         ui.addTextArea(0, "<p align = 'center'><font size='19'><b>".. maxPlayers + 1 .." Mice required to play the game!</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  565.     end
  566.     if chosen then
  567.         countdown = countdown - 1
  568.         if countdown == 0 then
  569.             newround = newround - 1
  570.             ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..won.." Won. Starting new round in "..newround.."</font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  571.             countdown = 2
  572.         end
  573.         if newround <= 0 then
  574.             for f = 0, 1500 do
  575.                 ui.removeTextArea(f , nil)
  576.             end
  577.             eventNewGame()
  578.             if repeatCards then
  579.                 cardsText()
  580.             end
  581.         end
  582.     end
  583.     if chosen2 then
  584.         countdown = countdown - 1
  585.         if countdown == 0 then
  586.             newgame = newgame - 1
  587.             newgame2 = newgame2 - 1
  588.             countdown = 2
  589.         end
  590.         if newgame <= 0 then
  591.             local key = -math.huge
  592.             for name in pairs(tfm.get.room.playerList) do
  593.                 if players[name].score > key then
  594.                     key = players[name].score
  595.                     ui.addTextArea(0,"<p align = 'center'><font size='17' color='#ff0000'><b>♕ "..name.." ♕</b></font>\n<font size='11'>Starting new game in "..newgame2.."</font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  596.                 end
  597.             end
  598.         end
  599.         if newgame2 <= 0 then
  600.             for f = 0, 1500 do
  601.                 ui.removeTextArea(f , nil)
  602.             end
  603.             finish = true
  604.             cardsText()
  605.         end
  606.     end
  607. end
  608. function eventPlayerLeft(name)
  609.     t = t - 1
  610.     if not ban[name] then
  611.         ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..name.." has left! :(</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  612.     end
  613.     if name == Judger then
  614.         while Judger == name do
  615.             Judger = Judge[math.random(1 , #Judge)]
  616.             tfm.exec.killPlayer(Judger)
  617.             tfm.exec.respawnPlayer(Judger)
  618.         end
  619.         if ban[name] then
  620.             ui.addTextArea(0, "<p align = 'center'><font size='14'><b>"..name.." has been banned! "..Judger.." is the new judger.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  621.         else
  622.             ui.addTextArea(0, "<p align = 'center'><font size='14'><b>"..name.." has left! "..Judger.." is the new judger.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  623.         end
  624.     end
  625.     for q = 1 , maxPlayers do
  626.         if name == Player[q] then
  627.             if i < maxPlayers then
  628.                 i = i - 1
  629.             end
  630.             if players[name].vote == 0 then
  631.                 getplace[q] = true
  632.                 if not ban[name] then
  633.                     ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..name.." has left! :( Type !join to take his place.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  634.                 else
  635.                     ui.addTextArea(0, "<p align = 'center'><font size='19'><b>"..name.." has been banned! :( Type !join to take his place.</b></font></p>", nil, 6, 354, 790, 50, 0x324650, 0x212f36, 0.8, move)
  636.                 end
  637.             end
  638.         end
  639.     end
  640. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement