Advertisement
HunYan

[Cards Against Mice]

Feb 2nd, 2018
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 57.18 KB | None | 0 0
  1. admins = { Heniyengui = true }
  2.  
  3. playersMax = 6      --This is the max of players who can join a game. (The number of chairs in the map)
  4.                     --Recommended: 6 Players. Maximum: 11 Players. Minimum: 3 Players.
  5.                     --Remember that if there are more than 6 persons PLAYING, there won't be Pick 2 cards nor Gambling.
  6.  
  7. repeatCards = true  -- If true, White Cards will repeat every round.
  8.                     -- So you may get the same card this round and the next rounds.
  9.                     -- If false, White Cards will repeat every new game. (This is like discarding them every round)
  10.                     -- Note: If there isn't enough White Cards and this is set to false the game will crash.
  11.  
  12.  
  13. -----------------------------------------------------------------------------------------------
  14.  
  15. -- Green Cards are White Cards.
  16. greenCard={}--You can add new cards by following this:   greenCard[number]="White Card Text Here"
  17. greenCard[1]="The hiccups."
  18. greenCard[2]="Suicidal thoughts."
  19. greenCard[3]="Gladiatorial combat."
  20. greenCard[4]="Stockholm syndrome."
  21. greenCard[5]="Insatiable bloodlust."
  22. greenCard[6]="Quiche."
  23. greenCard[7]="Leveling up."
  24. greenCard[8]="Genetically engineered super-soldiers."
  25. greenCard[9]="Fabricating statistics."
  26. greenCard[10]="Gandalf."
  27. greenCard[11]="Jean-Claude."
  28. greenCard[12]="Ashton Kutcher."
  29. greenCard[13]="The Fanta® girls."
  30. greenCard[14]="Shaft."
  31. greenCard[15]="Eating an albino."
  32. greenCard[16]="Neil Patrick Harris."
  33. greenCard[17]="A web of lies."
  34. greenCard[18]="Ripping into a man's chest and pulling out his still-beating heart."
  35. greenCard[19]="Cutting."
  36. greenCard[20]="The harsh light of day."
  37. greenCard[21]="Clams."
  38. greenCard[22]="NOOOOOOOOOO!!!"
  39. greenCard[23]="24-hour media coverage."
  40. greenCard[24]="The economy."
  41. greenCard[25]="A plunger to the face."
  42. greenCard[26]="A smiling black man, a latina businesswoman, a cool asian, and some whites."
  43. greenCard[27]="Words, words, words."
  44. greenCard[28]="Dorito breath."
  45. greenCard[29]="My machete."
  46. greenCard[30]="Space muffins."
  47. greenCard[31]="Media coverage."
  48. greenCard[32]="A beached whale."
  49. greenCard[33]="Slow motion."
  50. greenCard[34]="A passionate Latino lover."
  51. greenCard[35]="Clenched butt cheeks."
  52. greenCard[36]="Appreciative snapping."
  53. greenCard[37]="Historical revisionism."
  54. greenCard[38]="Mom."
  55. greenCard[39]="The four arms of Vishnu."
  56. greenCard[40]="Getting abducted by Peter Pan."
  57. greenCard[41]="Mad hacky-sack skills."
  58. greenCard[42]="Being a dinosaur."
  59. greenCard[43]="Statistically validated stereotypes."
  60. greenCard[44]="A rival dojo."
  61. greenCard[45]="George Clooney's musk."
  62. greenCard[46]="This guy"
  63. greenCard[47]="Pistol-whipping a hostage."
  64. greenCard[48]="Sudden Poop Explosion Disease."
  65. greenCard[49]="Bosnian chicken farmers."
  66. greenCard[50]="A fat bald man from the internet."
  67. greenCard[51]="One thousand Slim Jims."
  68. greenCard[52]="Moral ambiguity."
  69. greenCard[53]="Dancing with a broom."
  70. greenCard[54]="Medieval Times® Dinner & Tournament."
  71. greenCard[55]="The shambling corpse of Larry King."
  72. greenCard[56]="A nuanced critique."
  73. greenCard[57]="Hipsters."
  74. greenCard[58]="Jafar."
  75. greenCard[59]="An atomic wedgie."
  76. greenCard[60]="Good grammar."
  77. greenCard[61]="Ominous background music."
  78. greenCard[62]="Savagely beating a mascot."
  79. greenCard[63]="Santa Claus."
  80. greenCard[64]="Apologizing."
  81. greenCard[65]="Enormous Scandinavian women."
  82. greenCard[66]="A low standard of living."
  83. greenCard[67]="Being a busy adult with many important things to do."
  84. greenCard[68]="Finding a skeleton."
  85. greenCard[69]="Ryan Gosling riding in on a white horse."
  86. greenCard[70]="Free samples."
  87. greenCard[71]="Natural selection."
  88. greenCard[72]="Italians."
  89. greenCard[73]="The Jews."
  90. greenCard[74]="Finger painting."
  91. greenCard[75]="Puppies"
  92. greenCard[76]="A disappointing birthday party."
  93. greenCard[77]="Science."
  94. greenCard[78]="Poor people."
  95. greenCard[79]="College."
  96. greenCard[80]="A moment of silence."
  97. greenCard[81]="Racism."
  98. greenCard[82]="Ghosts."
  99. greenCard[83]="Bacteria."
  100. greenCard[84]="Flash flooding."
  101. greenCard[85]="Barack Obama."
  102. greenCard[86]="High school."
  103. greenCard[87]="Homeless people."
  104. greenCard[88]="Darth Vader."
  105. greenCard[89]="Bill Nye the Science Guy."
  106. greenCard[90]="The Force."
  107. greenCard[91]="The Big Bang."
  108. greenCard[92]="Dropping a chandelier on your enemies and riding the rope up."
  109. greenCard[93]="Chainsaws for hands."
  110. greenCard[94]="A really cool hat."
  111. greenCard[95]="World peace."
  112. greenCard[96]="A tiny horse."
  113. greenCard[97]="A time travel paradox."
  114. greenCard[98]="Pretending to care."
  115. greenCard[99]="Being on fire."
  116. greenCard[100]="Substitue teachers."
  117. greenCard[101]="Sunshine and rainbows."
  118. greenCard[102]="Men."
  119. greenCard[103]="BATMAN!!!"
  120. greenCard[104]="Friends who eat all the snacks."
  121. greenCard[105]="Being rich."
  122. greenCard[106]="Over-sized lollipops."
  123. greenCard[107]="Doing the right thing."
  124. greenCard[108]="Republicans."
  125. greenCard[109]="A balanced breakfast."
  126. greenCard[110]="Grandma."
  127. greenCard[111]="Global warming."
  128. greenCard[112]="Explosions."
  129. greenCard[113]="Goblins."
  130. greenCard[114]="Tiger Woods."
  131. greenCard[115]="Racially-biased SAT questions."
  132. greenCard[116]="Hurricane Katrina."
  133. greenCard[117]="Geese."
  134. greenCard[118]="Obesity."
  135. greenCard[119]="A bag of magic beans."
  136. greenCard[120]="Whips."
  137. greenCard[121]="Helping yourself."
  138. greenCard[122]="Big hair."
  139. greenCard[123]="Donald Trump."
  140. greenCard[124]="Hillary Clinton."
  141. greenCard[125]="Coming soon."
  142. greenCard[126]="Passion Fruit."
  143. greenCard[127]="Prescription Drugs."
  144. greenCard[128]="Crabs."
  145. greenCard[129]="Something frilly."
  146. greenCard[130]="Beating a dead shaman."
  147. greenCard[131]="Heavy breathing."
  148. greenCard[132]="shippings <3"
  149. greenCard[133]="A burning sensation in an awkward place."
  150. greenCard[134]="Something fishy."
  151. greenCard[135]="Evil laughter."
  152. greenCard[136]="A coming out party."
  153. greenCard[137]="The 1%"
  154. greenCard[138]="Love is love."
  155. greenCard[139]="One of those trashy show about redneck women."
  156. greenCard[140]="Farting in public."
  157. greenCard[141]="Sir Lancelot."
  158. greenCard[142]="Mario and Princess Peach."
  159. greenCard[143]="Sonic the hedgehog."
  160. greenCard[144]="Black Butler."
  161. greenCard[145]="Anime."
  162. greenCard[146]="Magic fingers."
  163. greenCard[147]="Sucking at everything."
  164. greenCard[148]="A bomb shell."
  165. greenCard[149]="The root of all evil."
  166. greenCard[150]="Long John Silvers."
  167. greenCard[151]="Oddly shaped feet."
  168. greenCard[152]="A cracker."
  169. greenCard[153]="Swearing in sign language."
  170. greenCard[154]="The death penalty."
  171. greenCard[155]="HUMP DAY!"
  172. greenCard[156]="Slip'n'Slides"
  173. greenCard[157]="Prom night."
  174. greenCard[158]="Tipping a port-a-potty with someone inside."
  175. greenCard[159]="Tongs."
  176. greenCard[160]="Im a queen."
  177. greenCard[161]="Human sacrafices."
  178. greenCard[162]="None of your business."
  179. greenCard[163]="Toys."
  180. greenCard[164]="Hot co workers."
  181. greenCard[165]="A ken doll."
  182. greenCard[166]="Being sent to the penalty box."
  183. greenCard[167]="The unspoken language of love."
  184. greenCard[168]="Angel wing tattoos."
  185. greenCard[169]="A jar of vaseline."
  186. greenCard[170]="A peeping tom."
  187. greenCard[171]="breaking wind."
  188. greenCard[172]="Death by chocolate."
  189. greenCard[173]="My hot neighbor."
  190. greenCard[174]="Donald Trump's hair."
  191. greenCard[175]="Black magic."
  192. greenCard[176]="A racist family member."
  193. greenCard[177]="Victoria's Secret."
  194. greenCard[178]="The crack of dawn."
  195. greenCard[179]="Night moves."
  196. greenCard[180]="An animatronic snowman."
  197. greenCard[181]="Kim Jong-un."
  198. greenCard[182]="Fishnets."
  199. greenCard[183]="Affirmative Action."
  200. greenCard[184]="Deciding to become a professional wrestler."
  201. greenCard[185]="Acid."
  202. greenCard[186]="World religions."
  203. greenCard[187]="Artificial intelligence."
  204. greenCard[188]="Low impact aerobics."
  205. greenCard[189]="A naughty girl."
  206. greenCard[190]="The homeless."
  207. greenCard[191]="Poking a hole."
  208. greenCard[192]="Hanky-panky."
  209. greenCard[193]="Men in uniform."
  210. greenCard[194]="squishy things."
  211. greenCard[195]="America's sweetheart."
  212. greenCard[196]="A load of BS."
  213. greenCard[197]="Missionary."
  214. greenCard[198]="A little crack."
  215. greenCard[199]="Something stiff."
  216. greenCard[200]="Cold hard cash."
  217. greenCard[201]="Faking it."
  218. greenCard[202]="Play the race card."
  219. greenCard[203]="Waxing."
  220. greenCard[204]="Karma."
  221. greenCard[205]="The love canal."
  222. greenCard[206]="Taking it the wrong way."
  223. greenCard[207]="Seven deadly sins."
  224. greenCard[208]="Tooting your own horn."
  225. greenCard[209]="Grandma's hair."
  226. greenCard[210]="A booger."
  227. greenCard[211]="Eating boogers."
  228. greenCard[212]="A used diaper I found on the side of the road."
  229.  
  230.  
  231.  
  232. -- Purple Cards Are Black Cards.
  233. purpleCard={}--You can add new cards by following this:   purpleCard[number]="Black Card Text Here"
  234. purpleCard[1]="My plan for world domination begins with _____."
  235. purpleCard[2]="I learned the hard way that you can't cheer up a grieving friend with _____."
  236. purpleCard[3]="The socialist governments of Scandinavia have declared that access to _____ is a basic human right."
  237. purpleCard[4]="What's the gift that keeps on giving? _____."
  238. purpleCard[5]="He who controls _____ controls the world."
  239. purpleCard[6]="The CIA now interrogates enemy agents by repeatedly subjecting them to _____."
  240. purpleCard[7]="Science will never explain the origin of _____."
  241. purpleCard[8]="Next season on Man vs, Wild, Bear Grylls must survive the depths of the Amazon with only _____ and his wits."
  242. purpleCard[9]="In the distant future, historians will agree that _____ marked the beginning of America's decline."
  243. purpleCard[10]="When I pooped, what came out of my butt? _____."
  244. purpleCard[11]="In Rome, there are whisperings that the Vatican has a secret room devoted to _____."
  245. purpleCard[12]="And I would have gotten away with it, too, if it hadn't been for _____"
  246. purpleCard[13]="In his new self-produced album, Kanye West raps over the sounds of _____."
  247. purpleCard[14]="In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated _____."
  248. purpleCard[15]="If I could have a secret power, I would have _____."
  249. purpleCard[16]="TSA guidelines now prohibit _____ on airplanes."
  250. purpleCard[17]="What would grandma find disturbing, yet oddly charming? _____"
  251. purpleCard[18]="I'm sorry, Professor, but I couldn't complete my homework because of _____."
  252. purpleCard[19]="Life was difficult for cavemen before _____."
  253. purpleCard[20]="What gets better with age? _____"
  254. purpleCard[21]="_____? There's an app for that."
  255. purpleCard[22]="When I am a billionare, I shall erect a 50-foot statue to commemorate _____."
  256. purpleCard[23]="What don't you want to find in your Chinese food? _____"
  257. purpleCard[24]="It's a pity that kids these days are all getting involved with _____."
  258. purpleCard[25]="Anthropologists have recently discovered a primitive tribe that worships _____."
  259. purpleCard[26]="When I am the President of the United States, I will create the Department of _____."
  260. purpleCard[27]="The class field trip was completely ruined by _____."
  261. purpleCard[28]="In 1,000 years, when paper money is but a distant memory, _____ will be our currency."
  262. purpleCard[29]="_____. It's a trap"
  263. purpleCard[30]="What's there a ton of in heaven? _____"
  264. purpleCard[31]="What will I bring back in time to convince people that I am a powerful wizard? _____"
  265. purpleCard[32]="_____: kid-tested, mother-approved."
  266. purpleCard[33]="When Pharaoh remained unmoved, Moses called down a plague of _____."
  267. purpleCard[34]="______ should be grounds for a national holiday."
  268. purpleCard[35]="Apply this medication three times a day to reduce _______."
  269. purpleCard[36]="Oddly enough, I've developed a taste for _______"
  270. purpleCard[37]="In my life, theres always room for more _____"
  271. purpleCard[38]="All you need is ____"
  272. purpleCard[39]="I'd love to celebrate valentines day with ____"
  273. purpleCard[40]="If I could take something to a deserted island, I would take ___"
  274. purpleCard[41]="You know what annoys me? ____"
  275. purpleCard[42]="I use ____ in a way that would make you blush"
  276. purpleCard[43]="I used to get in trouble for playing with ____"
  277. purpleCard[44]="This place smells like ____"
  278. purpleCard[45]="I may forget a name, I may forget a face, but I will never forget ___"
  279. purpleCard[46]="according to the doctor I have a problem with ___"
  280. purpleCard[47]="What do I want for my birthday? My birthday suit and ___'"
  281. purpleCard[48]="I can't be friends with people who are interested in ____"
  282. purpleCard[49]="What do I rub for good luck?"
  283. purpleCard[50]="____ will make anyone seem more attractive"
  284. purpleCard[51]="When I roleplay I like to pretend I'm ____"
  285. purpleCard[52]="My guidance counselor told me I should focus on ____ as a career choice"
  286. purpleCard[53]="Am I the only one who hates ____"
  287. purpleCard[54]="My ex broke up with me because of my fondness for ____"
  288. purpleCard[55]="Everyone thinks im all about ___ and for the most part they're right"
  289. purpleCard[56]="What do you not want to find on your pizza?"
  290.  
  291. ---------------------------------------------------------------------------------------------------------------------------
  292. pick2Cards = {}
  293. pick2Cards[1]="I had a terrible nightmare about _____ and _____."
  294. pick2Cards[2]="We go together like _____ and _____."
  295. pick2Cards[3]="If I were a mad scientist, I would try to combine _____ and _____"
  296. pick2Cards[4]="Nothing is certain except _____ and _____"
  297. pick2Cards[5]="_____ would be woefully incomplete without _____."
  298. pick2Cards[6]="An international tribunal has found _____ guilty of _____."
  299. pick2Cards[7]="And the Academy Award for _____ goes to _____."
  300. pick2Cards[8]="I never truly understood _____ until I encountered _____."
  301. pick2Cards[9]="Dear Sir or Madam, We regret to inform you that the office of _____ has denied your request for _____."
  302. pick2Cards[10]="I spent my whole life working toward _____, only to have it ruined by _____."
  303. pick2Cards[11]="You haven't truly lived until you've experienced _____ and _____ at the same time."
  304. ---------------------------------------------------------------------------------------------------------------------------
  305.  
  306. blackCardColor = 0x000000
  307. whiteCardColor = 0xFFFFFF
  308. move = false
  309.  
  310. themaps = { [1] = { bg = "x_transformice/x_maps/x_peche2014/x_temple.jpg" , color = "67675F" , color2 = "AEBDA6" } ,
  311.         [2] = { bg = "x_transformice/x_maps/x_peche2015/map-aventure-1.jpg" , color = "6598" , color2 = "5b91df" } ,
  312.         [3] = { bg = "x_transformice/x_maps/x_papaques_2015/map2.jpg,0,-150" , color = "24ACA6" , color2 = "5FEFF8" } ,
  313.         [4] = { bg = "x_bouboum/x_fond/x_f5.jpg" , color = "BA8973" , color2 = "DAB684" } ,
  314.         [5] = { bg = "x_transformice/x_maps/x_halloween2015/eclairs.jpg" , color = "1C3934" , color2 = "264740" } ,
  315.         [6] = { bg = "x_transformice/x_maps/x_papaques_2015/map1.jpg,0,-250" , color = "591F2D" , color2 = "DC4D64" } ,
  316.         [7] = { bg = "x_transformice/x_maps/x_peche2014/x_nuages.jpg" , color = "33" , color2 = "52057" } ,
  317.         [8] = { bg = "x_transformice/x_maps/x_rentree2015/map-proviseur.jpg,0,-55" , color = "743F24" , color2 = "AE663B" } ,
  318.         }
  319.  
  320. ----------------------------------------------------------------------------------------------------------------------------
  321.  
  322. greencard={}
  323. purplecard={}
  324.  
  325. tfm.exec.disableAutoNewGame(true)
  326. tfm.exec.disableAfkDeath(true)
  327. tfm.exec.disableAutoShaman(true)
  328. tfm.exec.disableAutoScore(true)
  329. tfm.exec.disableAutoTimeLeft(true)
  330.  
  331. players = {}
  332. t = 0
  333. ban = {}
  334. getplace = {}
  335. pTime = 32
  336. newgame = 5
  337.  
  338. for r = 1, #pick2Cards do
  339. purpleCard[#purpleCard + 1] = "PICK2"
  340. end
  341. if playersMax > 11 then
  342. playersMax = 11
  343. end
  344. if playersMax < 3 then
  345. playersMax = 3
  346. end
  347. function invert(t,v)
  348. for k,value in pairs(t) do
  349. if value==v then
  350. return k
  351. end
  352. end
  353. return nil
  354. end
  355. function banPlayer()
  356.     for name in pairs(tfm.get.room.playerList) do
  357.         if ban[name] then
  358.             tfm.exec.killPlayer(name)
  359.             for f = 500, 1500 do
  360.                 ui.removeTextArea(f , name)
  361.             end
  362.         end
  363.     end
  364. end
  365. function firstToUpper(str)
  366.     return (str:gsub("^%l", string.upper))
  367. end
  368. function eventNewPlayer(name)
  369.     ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>Welcome to Cards Against Mice!</b></font></p>", name, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)  
  370.     for w = 1, #Pos do
  371.         if Pos[w].taken then
  372.             if Player[w] ~= nil then
  373.                 ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>"..Player[w].."</b></font></p>", name, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  374.             else
  375.                 ui.addTextArea(19 + w, "<p align = 'center'><font size='10' color='#ff0000' ><b>"..Judger.."</b></font></p>", name, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  376.             end
  377.         else
  378.             if sTime <= 30 or ( getplace[w] and not start2 ) then
  379.                 ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>[Space]</b></font></p>", name, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  380.             end
  381.         end
  382.     end
  383.     if sTime == 31 then
  384.         if pick2 then
  385.             ui.addTextArea(1,"<p align='justify'><b><font size='11' color='#ffffff'>"..pick2Cards[cardn].."</font></b></p>",  name, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
  386.             ui.addTextArea(2, "<p align='center'><font color='#ffffff' size='12'><b>PICK 2</b></font></p>", name, 110, 224, 63, 20, 0x324650, 0x000001, 0, move)
  387.         else
  388.             ui.addTextArea(1,"<p align='justify'><b><font size='11' color='#ffffff'>"..purpleCard[carde].."</font></b></p>",  name, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
  389.         end
  390.         for a = 1, #Pos do
  391.         local namee, yyy = Player[a], 0
  392.             if namee ~= nil then
  393.                 if pick2 then
  394.                     if players[namee].pick2 == 1 then
  395.                         yyy = 0
  396.                         ui.addTextArea(ids[a][1] + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",name,players[namee].xx + 180 , yyy + 143,110,64, whiteCardColor, 0x000000, 1, move)
  397.                     elseif players[namee].pick2 == 2 then
  398.                         yyy = 75
  399.                         ui.addTextArea(ids[a][2] + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",name,players[namee].xx + 180 , yyy + 143,110,64, whiteCardColor, 0x000000, 1, move)
  400.                     end
  401.                 else
  402.                     for k, v in pairs(ids[a]) do
  403.                         ui.addTextArea(ids[a][k] + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",name,players[namee].xx[k] + 180 , players[namee].yy[k] + 143,110,64, whiteCardColor, 0x000000, 1, move)
  404.                     end
  405.                 end
  406.             end
  407.         end
  408.         if start2 then
  409.             for a = 1, #Pos do
  410.                 if Player[a] ~= nil then
  411.                     if pick2 then
  412.                         ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",name)
  413.                         ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",name)
  414.                     else
  415.                         ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",name)
  416.                         if players[Player[a]].gamble then
  417.                             ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",name)
  418.                         end
  419.                     end
  420.                 end
  421.             end
  422.         end
  423.     else
  424.         ui.addTextArea(1, "<p align = 'justify'><b><font size='14' face='impact' color='#ffffff'>♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦</font></b></p>", name, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
  425.         ui.addTextArea(2, "<p align = 'center'><b><font size='19' face='impact' color='#ffffff'>Black Card</font></b></p>", name, 28, 177, 110, 30, blackCardColor, 0x000001, 1, move)
  426.     end
  427.     tfm.exec.bindKeyboard(name,32,true,true)
  428.     banPlayer()
  429.     t = t + 1
  430.     players[name] = { vote = 0 , score = 0, gamble = false, xx = {} , yy={} }
  431.     if not ban[name] then
  432.         tfm.exec.respawnPlayer(name)
  433.     end
  434.     tfm.exec.setPlayerScore(name,0,false)
  435.     ui.addPopup(0,0,"<p align = 'center'><font size='50' face='Agency FB'><b>Cards Against Mice</b></font></p><font size='20' color='#CC0000'><b>About it</b></font><font size='13'>\nCards Against Mice 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 black card randomly, and everyone else must submit a white card. The judger will not know whos card is which until he/she picks the one they like the best. There are currently "..#purpleCard.." Black Cards and "..#greenCard.." White 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 forum members for helping.</font>",name,50,20,700,true)
  436.     if t == 3 and not finish then
  437.         chosen2 = true
  438.         newgame2 = 0
  439.     end
  440.     if t >= 3 and i < 2 and sTime == 31 then
  441.         chosen2 = true
  442.         newgame2 = 0
  443.     end
  444. end
  445. function deepCopy(object)
  446.     local lookup_table = {}
  447.     local function _copy(object)
  448.         if type(object) ~= "table" then
  449.             return object
  450.         elseif lookup_table[object] then
  451.             return lookup_table[object]
  452.         end
  453.         local new_table = {}
  454.         lookup_table[object] = new_table
  455.         for index, value in pairs(object) do
  456.             new_table[_copy(index)] = _copy(value)
  457.         end
  458.         return setmetatable(new_table, getmetatable(object))
  459.     end
  460.     return _copy(object)
  461. end
  462. map = deepCopy(themaps)
  463.  
  464. c = 0
  465. function cardsText()
  466.     greencard = deepCopy(greenCard)
  467.     if finish then
  468.         Judgee = {}
  469.         cards = {}
  470.         i=0
  471.         c=0
  472.         Pos = {}
  473.         for w = 1,playersMax do
  474.             getplace[w] = false
  475.             Pos[w] = { x1 = -22 + math.floor(800/playersMax)*(w) - math.floor((800/playersMax)/2) , x2 = 22 + math.floor(800/playersMax)*(w) - math.floor((800/playersMax)/2) , taken = false }
  476.             ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>[Space]</b></font></p>", nil, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  477.         end
  478.         countdown = 2
  479.         sTime = 30
  480.         Player = { }
  481.         purplecard = deepCopy(purpleCard)
  482.         purplecard[0] = ""
  483.         pick2cards = deepCopy(pick2Cards)
  484.         pick2cards[0] = ""
  485.         round = 0
  486.         maxr = 5
  487.         for name in pairs(tfm.get.room.playerList) do
  488.             players[name] = { vote = 0 , score = 0 , gamble = false , xx={} , yy={} }
  489.             tfm.exec.setPlayerScore(name,0,false)
  490.             players[name].score = 0
  491.         end
  492.         local h = 0
  493.         for k, v in pairs(map) do
  494.             if map[k].bg == nil then
  495.                 h = k
  496.         end
  497.         end
  498.         if h == #themaps  then
  499.             map = deepCopy(themaps)
  500.         end
  501.         mapo = math.random(1 , #themaps)
  502.         while map[mapo].bg == nil do
  503.             mapo = math.random(1 , #themaps)
  504.         end
  505.         local str = ''
  506.         for i = 1 , playersMax do
  507.         str = str .. "<P C=\"757575\" Y=\"123\" T=\"19\" X=\"".. Pos[i].x1 + 22 .."\" P=\"0,0\" />"
  508.         end
  509.         map1 = "<C><P D=\""..map[mapo].bg.."\" /><Z><S><S L=\"800\" o=\""..map[mapo].color.."\" H=\"37\" X=\"400\" Y=\"118\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /><S P=\"0,0,0.3,0.2,0,0,0,0\" L=\"800\" o=\""..map[mapo].color.."\" X=\"400\" Y=\"382\" T=\"12\" H=\"37\" /><S P=\"0,0,0,9999,0,0,0,0\" L=\"10\" o=\"6598\" X=\"-5\" Y=\"200\" T=\"12\" H=\"420\" /><S L=\"800\" o=\"6598\" X=\"400\" H=\"10\" Y=\"-5\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /><S P=\"0,0,0,9999,0,0,0,0\" L=\"10\" o=\"6598\" H=\"420\" Y=\"200\" T=\"12\" X=\"805\" /><S P=\"0,0,0.3,0.2,0,0,0,0\" L=\"800\" o=\"6598\" H=\"10\" Y=\"405\" T=\"12\" X=\"400\" /><S P=\"0,0,0.3,0.2,0,0,0,0\" L=\"500\" o=\"6a7495\" X=\"-250\" N=\"\" c=\"4\" Y=\"200\" T=\"12\" H=\"450\" /><S H=\"500\" L=\"1500\" o=\"6a7495\" X=\"400\" N=\"\" c=\"4\" Y=\"-250\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /><S H=\"450\" L=\"500\" o=\"6a7495\" X=\"1050\" N=\"\" c=\"4\" Y=\"200\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /></S><D><P C=\""..map[mapo].color2.."\" Y=\"99\" T=\"34\" P=\"0,0\" X=\"0\" /><DS Y=\"84\" X=\"412\" />"..str.."</D><O /></Z></C>"             
  510.         tfm.exec.newGame(map1)
  511.         map[mapo].bg = nil
  512.     end
  513. end
  514. finish = true
  515. cardsText()
  516. function setJudger(name)
  517.     Judger = name
  518.     ui.addTextArea(0, "<p align = 'center'><font size='16' color='#ffffff'><b>"..name.." is the new judger.</b></font></p>", nil, 6, 368, 790, 50, 0x324650, 0x212f36, 0, move)
  519.     local b = 0
  520.     for f in pairs(tfm.get.room.playerList) do
  521.         if players[f].vote == 1 then
  522.             b = b + 1
  523.             if b == i and not chosen and not chosen2 then
  524.                 for c = 1, #Pos do
  525.                     if Player[c] ~= nil then
  526.                         if pick2 then
  527.                             ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][1].."</font></b></p>",nil)
  528.                             ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][1].."\n\n\n\n\n\n</a></font></b></p>",name)
  529.                             ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][2].."</font></b></p>",nil)
  530.                             ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][2].."\n\n\n\n\n\n</a></font></b></p>",name)
  531.                         else
  532.                             ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][1].."</font></b></p>",nil)
  533.                             ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][1].."\n\n\n\n\n\n</a></font></b></p>",name)
  534.                             if players[Player[c]].gamble then
  535.                                 ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][2].."</font></b></p>",nil)
  536.                                 ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][2].."\n\n\n\n\n\n</a></font></b></p>",name)
  537.                             end
  538.                         end
  539.                     end
  540.                 end
  541.             end
  542.         end
  543.     end
  544.     if Player[Judger] ~= nil then
  545.         Judgee[Judger] = true
  546.         ui.addTextArea(19 + Player[name], "<p align = 'center'><font size='10' color='#ff0000' ><b>"..name.."</b></font></p>", nil, Pos[Player[name]].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  547.         c = Player[Judger]
  548.         Player[Judger] = nil
  549.         Player[c] = nil
  550.         i = i - 1
  551.     end
  552. end
  553. function eventNewGame()
  554.     pick2 = false
  555.     tfm.exec.setUIMapName("Cards Against Mice!")
  556.     maxPlayers = 0
  557.     if c ~= 0 then
  558.         Player[c] = Judger
  559.         Player[Judger] = c
  560.         i = i + 1
  561.         ui.addTextArea(19 + c, "<p align = 'center'><font size='10'><b>"..Player[c].."</b></font></p>", nil, Pos[c].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  562.     end
  563.     banPlayer()
  564.     if t >= 3 then
  565.         round = round + 1
  566.         if round == maxr then
  567.             ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Last Round</b></font>", nil, 20, 240, 240, 50, 0x324650, 0x000000, 0, move)
  568.             sTime = 0
  569.         else
  570.             if round ~= 1 then
  571.                 sTime = 0
  572.                 ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Round "..round.."</b></font>", nil, 30, 240, 240, 50, 0x324650, 0x000000, 0, move)
  573.             else
  574.                 ui.addTextArea(1, "<p align = 'justify'><b><font size='14' face='impact' color='#ffffff'>♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦</font></b></p>", nil, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
  575.                 ui.addTextArea(2, "<p align = 'center'><b><font size='19' face='impact' color='#ffffff'>Black Card</font></b></p>", nil, 28, 177, 110, 30, blackCardColor, 0x000001, 1, move)
  576.                 i = 0
  577.                 ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>Press space to have a seat. (Players : "..i..")</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  578.                 ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Round "..round.."</b></font>", nil, 30, 240, 240, 50, 0x324650, 0x000000, 0, move)
  579.             end
  580.         end
  581.     else
  582.         ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>3 Mice required to play the game!</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  583.     end
  584.     xx = 0
  585.     y = 0
  586.     start = false
  587.     start2 = false
  588.     finish = false
  589.     countdown = 2
  590.     newround = 7
  591.     ids = {}
  592.     Judger = ""
  593.     won = ""
  594.     chosen = false
  595.     chosen2 = false
  596.     newgame2 = 13
  597.     newgame = 5
  598.     pTime = 32
  599.     jTime = 32
  600.     Idea = {}
  601. end
  602. for name in pairs(tfm.get.room.playerList) do
  603.     eventNewPlayer(name)
  604. end
  605. function eventPlayerDied(name)
  606.     if not ban[name] then
  607.         tfm.exec.respawnPlayer(name)
  608.     end
  609. end
  610. function eventPlayerWon(name)
  611.     if not ban[name] then
  612.         tfm.exec.respawnPlayer(name)
  613.     end
  614. end
  615. function eventKeyboard(name, key, down, px, py)
  616.     if key == 32 then
  617.         for w = 1, #Pos do
  618.             if px >= Pos[w].x1 and px <= Pos[w].x2 and Player[name] == nil and t >= 3 and not ban[name] and not Pos[w].taken then
  619.                 if getplace[w] and not start and not start2 then
  620.                     Player[w] = name
  621.                     Player[name] = w
  622.                     getplace[w] = false
  623.                     Pos[w].taken = true
  624.                     ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>"..name.."</b></font></p>", nil, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  625.                     i = i + 1
  626.                         Idea[Player[p]] = {}
  627.                         ids[p] = {}
  628.                     local x = 0
  629.                     for s = w + (4 *  (w - 1) ) , 5 * w do
  630.                         if cards[s] ~= nil then
  631.                             ui.addTextArea(s + 50 ,"<p align='left'><b><font size='9' color='#000000'><a href='event:card"..s.."'>"..cards[s].."\n\n\n\n\n\n</a></font></b></p>",Player[w],x + 180 , 284,111,64, whiteCardColor, 0x000000, 1, move)
  632.                             x = x + 125
  633.                         end
  634.                     end
  635.                 end
  636.                 if Player[name] == nil and sTime <= 30 then
  637.                     i = i + 1
  638.                     Player[name] = w
  639.                     Player[w] = name
  640.                     Pos[w].taken = true
  641.                     ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>"..name.."</b></font></p>", nil, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  642.                     ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>Press space to have a seat. (Players : "..i..")</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  643.                     for e = 1,#Pos do
  644.                         if not Pos[e].taken then
  645.                             ui.removeTextArea(19 + e, name)    
  646.                         end            
  647.                     end
  648.                 end
  649.             end
  650.         end
  651.     end
  652. end
  653. function eventChatCommand(name, message)
  654.     if message == "restart" and admins[name] and not ban[name] then
  655.         chosen2 = true
  656.         newgame2 = 0
  657.     end
  658.     if message == "mods" then
  659.         local mod = ""
  660.         for playermod in pairs(tfm.get.room.playerList) do
  661.             if admins[playermod] then
  662.                 mod = ""..mod..""..playermod..", "
  663.             end
  664.         end
  665.         ui.addPopup(0,0,"<b><font size='20' color='#CB546B'>The admins are:</font>\n"..mod.."",name,100,50,600,true)
  666.     end
  667.     if message == "help" then
  668.         ui.addPopup(0,0,"<p align = 'center'><font size='50' face='Agency FB'><b>Cards Against Mice</b></font></p><font size='20' color='#CC0000'><b>About it</b></font><font size='13'>\nCards Against Mice 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 black card randomly, and everyone else must submit a white card. The judger will not know whos card is which until he/she picks the one they like the best. There are currently "..#purpleCard.." Black Cards and "..#greenCard.." White 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 forum members for helping.</font>",name,50,20,700,true)
  669.     end
  670.     if message == "commands" and not admins[name] then
  671.         ui.addPopup(0,0,"<b><font size='20' color='#CB546B'>Commands:</font>\n<font size='15' color='#BABD2F'>» Keyboard commands</font>\n<font color='#e68d43'>Spacebar</font> to have a seat and play.\n<font size='15' color='#BABD2F'>» Normal commands</font>\n<font color='#e68d43'>!mods</font> to see the current admins in the room.\n<font color='#e68d43'>!clear</font> to clear all shaman objects.\n<font color='#e68d43'>!help</font> to see informations about the game.",name,100,50,600,true)
  672.     end
  673.     if message == "commands" and admins[name] then
  674.         ui.addPopup(0,0,"<b><font size='20' color='#CB546B'>Commands:</font>\n<font size='15' color='#BABD2F'>» Keyboard commands</font>\n<font color='#e68d43'>Spacebar</font> to have a seat and play.\n<font size='15' color='#BABD2F'>» Admin commands</font>\n<font color='#e68d43'>!s</font> to become shaman.\n<font color='#e68d43'>!restart</font> to restart the game.\n<font color='#e68d43'>!ban username</font> to not let someone play.\n<font color='#e68d43'>!unban username</font> to unban someone if he got banned.\n<font color='#e68d43'>!admin username</font> to make someone admin.\n<font color='#e68d43'>!unadmin admin_name</font> to make an admin a normal player.\n<font color='#e68d43'>!setround number</font> to change the number of the next round.\n<font color='#e68d43'>!maxround number</font> to change the number of total rounds (Last round number).\n<font size='15' color='#BABD2F'>» Normal commands</font>\n<font color='#e68d43'>!mods</font> to see the current admins in the room.\n<font color='#e68d43'>!clear</font> to clear all shaman objects.\n<font color='#e68d43'>!help</font> to see informations about the game.",name,100,50,600,true)
  675.     end
  676.     local IDList = {}
  677.     if message=="clear" and not ban[name] then
  678.         for id, object in pairs(tfm.get.room.objectList) do
  679.             table.insert(IDList, id)
  680.         end
  681.         for i, id in pairs(IDList) do
  682.             tfm.exec.removeObject(id)
  683.         end
  684.     end
  685.     if message == "s" and admins[name] and not ban[name] then
  686.         tfm.exec.setShaman(name)
  687.     end
  688.     local message_args = {}
  689.     for arg in message:gmatch("[^%s]+") do
  690.         table.insert(message_args, arg)
  691.     end
  692.     if message_args[2] ~= nil then
  693.         if message_args[1] == "ban" and admins[name] and not ban[name] then
  694.             message_args[2] = firstToUpper(message_args[2])
  695.             ban[message_args[2]] = true
  696.             admins[message_args[2]] = false
  697.             banPlayer()
  698.             ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." has been banned! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  699.             eventPlayerLeft(message_args[2])
  700.         end
  701.         if message_args[1] == "admin" and admins[name] and not ban[name] then
  702.             message_args[2] = firstToUpper(message_args[2])
  703.             ban[message_args[2]] = false
  704.             admins[message_args[2]] = true
  705.             ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." is now a moderator!</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  706.         end
  707.         if message_args[1] == "unadmin" and admins[name] and not ban[name] then
  708.             message_args[2] = firstToUpper(message_args[2])
  709.             admins[message_args[2]] = false
  710.             ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." is no longer a moderator! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  711.         end
  712.         if message_args[1] == "unban" and admins[name] and not ban[name] then
  713.             t = t + 1
  714.             message_args[2] = firstToUpper(message_args[2])
  715.             ban[message_args[2]] = false
  716.             tfm.exec.respawnPlayer(message_args[2])
  717.             ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." has been unbanned! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  718.         end
  719.         if message_args[1] == "setround" and admins[name] and not ban[name] then
  720.             local number
  721.             for yy = 0, 200 do
  722.                 if tostring(yy) == message_args[2] then
  723.                     number = tonumber(message_args[2])
  724.                     if number > 0 and number <= maxr then
  725.                         round = number - 1
  726.                     end
  727.                 end
  728.             end
  729.         end
  730.         if message_args[1] == "maxround" and admins[name] and not ban[name] then
  731.             local number
  732.             for yy = 0, 200 do
  733.                 if tostring(yy) == message_args[2] then
  734.                     number = tonumber(message_args[2])
  735.                     if number > round  then
  736.                         maxr = number
  737.                     end
  738.                 end
  739.             end
  740.         end
  741.     end
  742. end
  743. function startGame1()
  744.     maxPlayers = i
  745.     if i >= 3 then
  746.         local count = 0
  747.         for k , v in pairs(Judgee) do
  748.             if Judgee[k] then
  749.                 count = count + 1
  750.             end
  751.         end
  752.         if count == i then
  753.             Judgee = {}
  754.         end
  755.         local j = 0
  756.         local Judge = {}
  757.         for name in pairs(tfm.get.room.playerList) do
  758.             players[name].vote = 0
  759.             players[name].pick2 = 0
  760.             players[name].xx = {}
  761.             players[name].yy = {}
  762.             players[name].gamble = false
  763.             if Player[name] ~= nil and name ~= Player[c] and not Judgee[name] and not ban[name] then
  764.                 j = j + 1
  765.                 Judge[j] = name
  766.             end
  767.         end
  768.         Judger = Judge[math.random(1 , #Judge)]
  769.         Judgee[Judger] = true
  770.         c = Player[Judger]
  771.         Player[Player[Judger]] = nil
  772.         Player[Judger] = nil
  773.         ui.addTextArea(19 + c, "<p align = 'center'><font size='10' color='#ff0000' ><b>"..Judger.."</b></font></p>", nil, Pos[c].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  774.         i = i - 1
  775.         ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>"..Judger.." will be judging this round. Waiting for players to choose a White card.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 0, move)
  776.         cardn = 0
  777.         carde = 0
  778.         while purplecard[carde] == "" do
  779.             carde = math.random(1,#purplecard)
  780.             if purplecard[carde] == "PICK2" then
  781.                 if i <= 5 then
  782.                     pick2 = true
  783.                     while pick2cards[cardn] == "" do
  784.                         cardn = math.random(1, #pick2cards)
  785.                     end
  786.                     purplecard[carde] = pick2cards[cardn]
  787.                 else
  788.                     purplecard[carde] = ""
  789.                 end
  790.             end
  791.         end
  792.         ui.addTextArea(1,"<p align='justify'><b><font size='11' color='#ffffff'>"..purplecard[carde].."</font></b></p>",  nil, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
  793.         purplecard[carde] = ""
  794.         if pick2 then
  795.             pick2cards[cardn] = ""
  796.             ui.addTextArea(2, "<p align='center'><font color='#ffffff' size='12'><b>PICK 2</b></font></p>", nil, 110, 224, 63, 20, 0x324650, 0x000001, 0, move)
  797.         else
  798.             ui.removeTextArea(2, nil)
  799.         end
  800.         for p = 1, #Pos do
  801.             if Player[p] ~= nil then
  802.                 ui.addTextArea(4 + p, "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[p], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
  803.                     Idea[Player[p]] = {}
  804.                     ids[p] = {}
  805.                 local x = 0
  806.                 for s = p + (4 *  (p - 1) ) , 5 * p do
  807.                     if cards[s] == nil then
  808.                         local n = math.random(1,#greencard)
  809.                         while greencard[n] == "" do
  810.                             n = math.random(1,#greencard)
  811.                         end
  812.                         cards[s] = greencard[n]
  813.                         x = 125 * (s - 5 * ( p - 1 ) - 1)
  814.                         ui.addTextArea(s + 50 ,"<p align='left'><b><font size='9' color='#000000'><a href='event:card"..s.."'>"..cards[s].."\n\n\n\n\n\n</a></font></b></p>",Player[p],x + 180 , 284,110,64, whiteCardColor, 0x000000, 1, move)
  815.                         greencard[n] = ""
  816.                     end
  817.                 end
  818.                 if not pick2 and i <= 5 and players[Player[p]].score > 0 then
  819.                     ui.addTextArea(4 + p, "<p align='center'><b><font size='11' color='#ffffff'><a href='event:gamble'>Gamble</a></font></b></p>", Player[p], 723, 371, 72, 21, 0x000000, 0xffffff, 1, move)
  820.                 end
  821.             end
  822.             if not Pos[p].taken then
  823.                 ui.removeTextArea(19 + p, nil)
  824.             end
  825.         end
  826.     end
  827. end
  828. function eventTextAreaCallback(id, name, cb)
  829.     if cb == "gamble" and Player[name] ~= nil and not players[name].gamble and not ban[name] then
  830.         ui.addTextArea(4 + Player[name], "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[p], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
  831.         players[name].gamble = true
  832.         players[name].vote = players[name].vote - 1
  833.         players[name].score = players[name].score - 1
  834.         tfm.exec.setPlayerScore(name,-1,true)
  835.     end
  836.     if cb == "card"..(id - 50).."" and players[name].vote <= 0 and not ban[name] and Player[name] ~= nil then
  837.         if pick2 then
  838.             players[name].pick2 = players[name].pick2 + 1
  839.             Idea[name][players[name].pick2] = cards[id - 50]
  840.             ids[Player[name]][players[name].pick2] = id
  841.             if players[name].pick2 == 1 then
  842.                 y = 0
  843.                 ui.addTextArea(id + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",nil,xx + 180 , y + 143,110,64, whiteCardColor, 0x000000, 1, move)
  844.                 players[name].xx = xx
  845.                 xx = xx + 125
  846.             else
  847.                 y = 75
  848.                 ui.addTextArea(id + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",nil,players[name].xx + 180 , y + 143,110,64, whiteCardColor, 0x000000, 1, move)
  849.                 players[name].vote = players[name].vote + 1
  850.             end
  851.             cards[id-50] = nil
  852.         else
  853.             if not players[name].gamble or players[name].vote == -1 then
  854.             Idea[name][1] = cards[id - 50]
  855.             ids[Player[name]][1] = id
  856.             players[name].xx[1] = xx
  857.             players[name].yy[1] = y
  858.             else
  859.             Idea[name][2] = cards[id - 50]
  860.             ids[Player[name]][2] = id
  861.             players[name].xx[2] = xx
  862.             players[name].yy[2] = y
  863.             end
  864.             ui.addTextArea(id + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",nil,xx + 180 , y + 143,110,64, whiteCardColor, 0x000000, 1, move)
  865.             xx = xx + 125
  866.             if xx == 625 then
  867.                 xx = 0
  868.                 y = 75
  869.             end
  870.             players[name].vote = players[name].vote + 1
  871.             cards[id-50] = nil
  872.         end
  873.         local h = 0
  874.         for name in pairs(tfm.get.room.playerList) do
  875.             if players[name].vote == 1 then
  876.                 h = h + 1
  877.                 if h == i then
  878.                     for a = 1, #Pos do
  879.                         getplace[a] = false
  880.                         if Player[a] ~= nil then
  881.                             ui.addTextArea(4 + a, "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[a], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
  882.                             if pick2 then
  883.                                 ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
  884.                                 ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  885.                                 ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
  886.                                 ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  887.                             else
  888.                                 ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
  889.                                 ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  890.                                 if players[Player[a]].gamble then
  891.                                     ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
  892.                                     ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  893.                                 end
  894.                             end
  895.                         end
  896.                     end
  897.                     ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>All the players chose a White card. Waiting for "..Judger.." to choose the funniest one.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 00, move)
  898.                     start2 = true
  899.                     start = true
  900.                 end
  901.             end
  902.         end
  903.         ui.removeTextArea(id, nil)
  904.     end
  905.     if start2 then
  906.         for winner in pairs(tfm.get.room.playerList) do
  907.             if cb==winner and winner ~= Judger and name == Judger and not chosen and not chosen2 then
  908.                 start = false
  909.                 jTime = 32
  910.                 won = winner
  911.                 for a = 1, #Pos do
  912.                     if Player[a] ~= nil then
  913.                         if pick2 then
  914.                             ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].." -"..Player[a].."</font></b></p>",nil)
  915.                             ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].." -"..Player[a].."</font></b></p>",nil)
  916.                         else
  917.                             ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].." -"..Player[a].."</font></b></p>",nil)
  918.                             if players[Player[a]].gamble then
  919.                                 ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].." -"..Player[a].."</font></b></p>",nil)
  920.                             end
  921.                         end
  922.                     end
  923.                 end
  924.                 if pick2 then
  925.                     ui.updateTextArea(ids[Player[winner]][1] + 500,"<p align='left'><b><font size='9' color='#ff0000'>"..Idea[winner][1].." -"..winner.."</font></b></p>",nil)
  926.                     ui.updateTextArea(ids[Player[winner]][2] + 500,"<p align='left'><b><font size='9' color='#ff0000'>"..Idea[winner][2].." -"..winner.."</font></b></p>",nil)
  927.                     tfm.exec.setPlayerScore(winner,2,true)
  928.                     players[winner].score = players[winner].score + 2
  929.                 else
  930.                     ui.updateTextArea(id,"<p align='left'><b><font size='9' color='#ff0000'>"..Idea[winner][invert(ids[Player[winner]],id - 500)].." -"..winner.."</font></b></p>",nil)
  931.                     tfm.exec.setPlayerScore(winner,1,true)
  932.                     players[winner].score = players[winner].score + 1
  933.                     for pn in pairs(tfm.get.room.playerList) do
  934.                         if players[pn].gamble then
  935.                             tfm.exec.setPlayerScore(winner,1,true)
  936.                             players[winner].score = players[winner].score + 1
  937.                         end
  938.                     end
  939.                 end
  940.                 if round == maxr then
  941.                     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, 367, 790, 50, 0x324650, 0x212f36, 0, move)
  942.                     chosen2 = true
  943.                 else
  944.                     ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..winner.." Won. Starting new round...</font></p>", nil, 6, 367, 790, 50, 0x324650, 0x212f36, 0, move)
  945.                     chosen = true
  946.                 end
  947.             end
  948.         end
  949.     end
  950. end
  951. function eventLoop()
  952.     for name in pairs(tfm.get.room.playerList) do
  953.         if ban[name] then
  954.             ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>You have been banned! :(</b></font></p>", name, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  955.         end
  956.     end
  957.     if t <= 2 then
  958.         ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>3 Mice required to play the game!</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  959.     end
  960.     if i < 2 and sTime==31 then
  961.         chosen2 = true
  962.         newgame2 = 0
  963.     end
  964.     if sTime <= 30 then
  965.         countdown = countdown - 1
  966.         if countdown == 0 then
  967.             countdown = 2
  968.             sTime = sTime - 1
  969.             ui.addTextArea(18,"<p align = 'center'><font size='14' color='#000000' face='Agency FB'><b>Game starts in\n<font size='40' color='#ff0000' face='Agency FB'><b>"..sTime.."</b></font></b></font></p>", nil, 28, 280, 100, 100, 0x324650, 0x212f36, 0, move)
  970.             if sTime <= 0 then
  971.                 if i <= 2 then
  972.                     chosen2 = true
  973.                     newgame2 = 0
  974.                 end
  975.                 startGame1()
  976.                 sTime = 31
  977.                 pTime = 30
  978.                 ui.removeTextArea(18, nil)
  979.             end
  980.         end
  981.     end
  982.     if pTime <= 30 and not start2 then
  983.         countdown = countdown - 1
  984.         if countdown == 0 then
  985.             countdown = 2
  986.             ui.addTextArea(18,"<p align = 'center'><font size='14' color='#000000' face='Agency FB'><b>Picking cards ends in\n<font size='40' color='#ff0000' face='Agency FB'><b>"..pTime.."</b></font></b></font></p>", nil, 3, 280, 150, 100, 0x324650, 0x212f36, 0, move)
  987.             pTime = pTime - 1
  988.             if pTime <= 0 then
  989.                 pTime = 32
  990.                 for a = 1,  #Pos do
  991.                     if getplace[a] then
  992.                         ui.removeTextArea(19 + a, nil)
  993.                         getplace[a] = false
  994.                     end
  995.                     if Player[a] ~= nil then
  996.                         ui.addTextArea(4 + a, "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[a], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
  997.                         if players[Player[a]].vote == 0 then
  998.                             getplace[a] = false
  999.                             for s = a + (4 *  (a - 1) ) , 5 * a do
  1000.                                 ui.removeTextArea(s + 50 ,Player[a])
  1001.                             end
  1002.                             Player[Player[a]] = nil
  1003.                             Player[a] = nil
  1004.                             ui.removeTextArea(19 + a, nil)
  1005.                             ui.removeTextArea(4 + a, nil)
  1006.                             Pos[a].taken = false
  1007.                             i = i - 1
  1008.                         end
  1009.                     end
  1010.                 end
  1011.                 for a = 1, #Pos do
  1012.                     if Player[a] ~= nil then
  1013.                         if pick2 then
  1014.                             ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
  1015.                             ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  1016.                             ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
  1017.                             ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  1018.                         else
  1019.                             ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
  1020.                             ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  1021.                             if players[Player[a]].gamble then
  1022.                                 ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
  1023.                                 ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
  1024.                             end
  1025.                         end
  1026.                     end
  1027.                 end
  1028.                 ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>All the players chose a White card. Waiting for "..Judger.." to choose the funniest one.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 00, move)
  1029.                 start2 = true
  1030.                 start = true
  1031.             end
  1032.         end
  1033.     end
  1034.     if start and sTime == 31 then
  1035.         countdown = countdown - 1
  1036.         if countdown == 0 then
  1037.             jTime = jTime - 1
  1038.             countdown = 2
  1039.             ui.addTextArea(18,"<p align = 'center'><font size='14' color='#000000' face='Agency FB'><b>Judger must pick a card before\n<font size='40' color='#ff0000' face='Agency FB'><b>"..jTime.."</b></font></b></font></p>", nil, 3, 280, 180, 100, 0x324650, 0x212f36, 0, move)
  1040.             if jTime <= 0 then
  1041.                 Judgee[Judger] = false
  1042.                 local count = 0
  1043.                 for k , v in pairs(Judgee) do
  1044.                     if Judgee[k] then
  1045.                         count = count + 1
  1046.                     end
  1047.                 end
  1048.                 if count == i then
  1049.                     Judgee = {}
  1050.                 end
  1051.                 local Judge = {}
  1052.                 jTime = 32
  1053.                 j = 0
  1054.                 ui.removeTextArea(19 + c, nil)
  1055.                 c = 0
  1056.                     for name in pairs(tfm.get.room.playerList) do
  1057.                         if not ban[name] and Player[name] ~= nil and name ~= Judger and not Judgee[name] then
  1058.                             j = j + 1
  1059.                             Judge[j] = name
  1060.                         end
  1061.                     end
  1062.                 setJudger(Judge[math.random(1 , #Judge)])
  1063.             end
  1064.         end
  1065.     end
  1066.     if chosen then
  1067.         countdown = countdown - 1
  1068.         if countdown == 0 then
  1069.             newround = newround - 1
  1070.             ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..won.." Won. Starting new round in "..newround.."</font></p>", nil, 6, 367, 790, 50, 0x324650, 0x212f36, 0, move)
  1071.             countdown = 2
  1072.         end
  1073.         if newround <= 0 then
  1074.             for f = 500, 1500 do
  1075.                 ui.removeTextArea(f , nil)
  1076.             end
  1077.             eventNewGame()
  1078.             if repeatCards then
  1079.                 cardsText()
  1080.             end
  1081.         end
  1082.     end
  1083.     if chosen2 then
  1084.         countdown = countdown - 1
  1085.         if countdown == 0 then
  1086.             newgame = newgame - 1
  1087.             newgame2 = newgame2 - 1
  1088.             countdown = 2
  1089.         end
  1090.         if newgame <= 0 then
  1091.             winners = {}
  1092.             local key = -math.huge
  1093.             local d = 0
  1094.             for name in pairs(tfm.get.room.playerList) do
  1095.                 if players[name].score > key then
  1096.                     key = players[name].score
  1097.                 end
  1098.             end
  1099.             for name in pairs(tfm.get.room.playerList) do
  1100.                 if players[name].score == key then
  1101.                     d = d + 1
  1102.                     winners[d] = name
  1103.                 end
  1104.             end
  1105.             local wintext = ""
  1106.             for j = 1, #winners do
  1107.                 wintext = ""..wintext..""..winners[j]..", "
  1108.                 ui.addTextArea(0,"<p align = 'center'><font size='16' color='#ff0000'><b> "..wintext.." </b></font>\n<font size='11' color='#ffffff'>Starting new game in "..newgame2.."</font></p>", nil, 6, 361, 790, 50, 0x324650, 0x212f36, 0, move)
  1109.             end
  1110.         end
  1111.         if newgame2 <= 0 then
  1112.             for f = 0, 1500 do
  1113.                 ui.removeTextArea(f , nil)
  1114.             end
  1115.             finish = true
  1116.             cardsText()
  1117.         end
  1118.     end
  1119. end
  1120. function eventPlayerLeft(name)
  1121.     t = t - 1
  1122.     if not ban[name] then
  1123.         ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has left! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  1124.     else
  1125.         ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has been banned! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  1126.     end
  1127.     if name == Judger then
  1128.         Judgee[Judger] = false
  1129.         if sTime == 31 and i >= 2 and not chosen and not chosen2 then
  1130.             jTime = 30
  1131.             local count = 0
  1132.             for k , v in pairs(Judgee) do
  1133.                 if Judgee[k] then
  1134.                     count = count + 1
  1135.                 end
  1136.             end
  1137.             if count == i then
  1138.                 Judgee = {}
  1139.             end
  1140.             while Judger == name do
  1141.                 local Judge = {}
  1142.                 j = 0
  1143.                     for pname in pairs(tfm.get.room.playerList) do
  1144.                         if not ban[pname] and Player[pname] ~= nil and pname ~= Judger and not Judgee[pname] then
  1145.                             j = j + 1
  1146.                             Judge[j] = pname
  1147.                         end
  1148.                     end
  1149.                 setJudger(Judge[math.random(1 , #Judge)])
  1150.             end
  1151.         end
  1152.         if ban[name] then
  1153.             ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>"..name.." has been banned! "..Judger.." is the new judger.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 0, move)
  1154.         else
  1155.             ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>"..name.." has left! "..Judger.." is the new judger.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 0, move)
  1156.         end
  1157.     end
  1158.     for q = 1 , #Pos do
  1159.         if Player[q] == name then
  1160.             Pos[q].taken = false
  1161.             ui.removeTextArea(29+q, nil)
  1162.             i = i - 1
  1163.             if players[name].vote == 0 then
  1164.                 if sTime == 31 then
  1165.                     getplace[q] = true
  1166.                     ui.addTextArea(19 + q, "<p align = 'center'><font size='10'><b>[Space]</b></font></p>", nil, Pos[q].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
  1167.                     if not ban[name] then
  1168.                         ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has left! :( You can replace him.</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  1169.                     else
  1170.                         ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has been banned! :( You can replace him.</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
  1171.                     end
  1172.                 end
  1173.             end
  1174.             Player[q] = nil
  1175.             Player[name] = nil 
  1176.         end
  1177.     end
  1178. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement