Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admins = { Heniyengui = true }
- maxPlayers = 5 -- Max 9 Players.
- move = false -- If true, All the text areas (The cards) will stay relative to the UI on scrolling maps,
- -- so if you move the text area will follow you.
- -- If false, all the text areas will stay in the same position on the map.
- repeatCards = true -- If true, Green Cards will repeat every round.
- -- So you may get the same card this round and the next rounds.
- -- If false, Green Cards will repeat every new game. (This is like discarding them every round)
- -- Note: If there isn't enough Green Cards and this is set to false the game will crash.
- -----------------------------------------------------------------------------------------------
- greenCard={}--You can add new cards by following this: greenCard[number]="Green Card Text Here"
- greenCard[1]="Whips"
- greenCard[2]="Helping yourself"
- greenCard[3]="Big hair"
- greenCard[4]="Barack Obama"
- greenCard[5]="Donald Trump"
- greenCard[6]="Hillary Clinton"
- greenCard[7]="Coming soon"
- greenCard[8]="Global warming"
- greenCard[9]="Passion Fruit"
- greenCard[10]="Prescription Drugs"
- greenCard[11]="Crabs"
- greenCard[12]="Something frilly"
- greenCard[13]="Beating a dead shaman"
- greenCard[14]="Heavy breathing"
- greenCard[15]="shippings <3"
- greenCard[16]="A burning sensation in an awkward place"
- greenCard[17]="Something fishy"
- greenCard[18]="Evil laughter"
- greenCard[19]="A coming out party"
- greenCard[20]="The 1%"
- greenCard[21]="Love is love"
- greenCard[22]="One of those trashy show about redneck women"
- greenCard[23]="Farting in public"
- greenCard[24]="Sir Lancelot"
- greenCard[25]="Mario and Princess Peach"
- greenCard[26]="Sonic the hedgehog"
- greenCard[27]="Black Butler"
- greenCard[28]="Anime"
- greenCard[29]="Magic fingers"
- greenCard[30]="Sucking at everything"
- greenCard[31]="A bomb shell"
- greenCard[31]="The root of all evil"
- greenCard[32]="Long John Silvers"
- greenCard[33]="Oddly shaped feet"
- greenCard[34]="A cracker"
- greenCard[35]="Swearing in sign language"
- greenCard[36]="The death penalty"
- greenCard[37]="HUMP DAY!"
- greenCard[38]="Slip'n'Slides"
- greenCard[39]="Prom night"
- greenCard[40]="Tipping a port-a-potty with someone inside"
- greenCard[41]="Tongs"
- greenCard[42]="Im a queen"
- greenCard[43]="Twerking"
- greenCard[44]="Public nudity"
- greenCard[45]="Human sacrafices"
- greenCard[46]="None of your business"
- greenCard[47]="Toys"
- greenCard[48]="Hot co workers"
- greenCard[49]="A ken doll"
- greenCard[50]="Being sent to the penalty box"
- greenCard[51]="The unspoken language of love"
- greenCard[52]="Angel wing tattoos"
- greenCard[53]="A jar of vaseline"
- greenCard[54]="A peeping tom"
- greenCard[55]="breaking wind"
- greenCard[56]="Death by chocolate"
- greenCard[57]="My hot neighbor"
- greenCard[58]="Donald Trump's hair"
- greenCard[59]="Black magic"
- greenCard[60]="A racist family member"
- greenCard[61]="Victoria's Secret"
- greenCard[62]="The crack of dawn"
- greenCard[63]="Night moves"
- greenCard[64]="An animatronic snowman"
- greenCard[65]="Kim Jong-un"
- greenCard[66]="Fishnets"
- greenCard[67]="Affirmative Action"
- greenCard[68]="Deciding to become a professional wrestler"
- greenCard[69]="Acid"
- greenCard[70]="Flashbacks"
- greenCard[71]="A virgin"
- greenCard[72]="World religions"
- greenCard[73]="Artificial intelligence"
- greenCard[74]="Low impact aerobics"
- greenCard[75]="A naughty girl"
- greenCard[76]="The homeless"
- greenCard[77]="Poking a hole"
- greenCard[78]="Hanky-panky"
- greenCard[79]="Men in uniform"
- greenCard[80]="squishy things"
- greenCard[81]="America's sweetheart"
- greenCard[82]="A load of BS"
- greenCard[83]="Missionary"
- greenCard[84]="A little crack"
- greenCard[85]="Something stiff"
- greenCard[86]="Cold hard cash"
- greenCard[87]="Faking it"
- greenCard[88]="Play the race card"
- greenCard[89]="Waxing"
- greenCard[90]="Karma"
- greenCard[91]="Lesbians"
- greenCard[92]="The love canal"
- greenCard[93]="Taking it the wrong way"
- greenCard[94]="Seven deadly sins"
- greenCard[95]="Tooting your own horn"
- greenCard[96]="Grandma"
- greenCard[97]="Grandma's hair"
- greenCard[98]="A booger"
- greenCard[99]="Eating boogers"
- greenCard[100]="A used diaper I found on the side of the road."
- purpleCard={}--You can add new cards by following this: purpleCard[number]="Purple Card Text Here"
- purpleCard[1]="______ should be grounds for a national holiday."
- purpleCard[2]="Apply this medication three times a day to reduce _______."
- purpleCard[3]="I had a terrible nightmare about _____."
- purpleCard[4]="We go together like ______."
- purpleCard[5]="Oddly enough, I've developed a taste for _______"
- purpleCard[6]="In my life, theres always room for more _____"
- purpleCard[7]="The trouble of an unfinished sentence is _____"
- purpleCard[8]="Nothing sexier than _____"
- purpleCard[9]="Nothing is certain except _____"
- purpleCard[10]="All you need is ____"
- purpleCard[11]="I'd love to celebrate valentines day with ____"
- purpleCard[12]="If I could take something to a deserted island, I would take ___"
- purpleCard[13]="You know what annoys me? ____"
- purpleCard[14]="I use ____ in a way that would make you blush"
- purpleCard[15]="I used to get in trouble for playing with ____"
- purpleCard[16]="This place smells like ____"
- purpleCard[17]="I may forget a name, I may forget a face, but I will never forget ___"
- purpleCard[18]="according to the doctor I have a problem with ___"
- purpleCard[19]="What do I want for my birthday? My birthday suit and ___'"
- purpleCard[20]="I can't be friends with people who are interested in ____"
- purpleCard[21]="What do I rub for good luck?"
- purpleCard[22]="____ will make anyone seem more attractive"
- purpleCard[23]="When I roleplay I like to pretend I'm ____"
- purpleCard[24]="My guidance counselor told me I should focus on ____ as a career choice"
- purpleCard[25]="Am I the only one who hates ____"
- purpleCard[26]="My ex broke up with me because of my fondness for ____"
- purpleCard[27]="Everyone thinks im all about ___ and for the most part they're right"
- purpleCard[28]="What do you not want to find on your pizza?"
- purpleCard[29]="What would grandma find disturbing yet oddly charming?"
- purpleCard[30]="Introducing extreme vanilla! It's like vanilla but with ___"
- purpleCard[31]="Having tired of noobs and cheese, the immortal shamans now fill their days with ____."
- purpleCard[31]="What helps the Shaman relax?"
- purpleCard[32]="And in the end, the Shaman was not evil, he just wanted ___"
- purpleCard[33]="Life for mice forever changed when the Shaman introduced them to ____"
- purpleCard[34]="When I finally become mayor in transformice, I will create ___"
- purpleCard[35]="What is my guilty pleasure?"
- purpleCard[36]="I'm sorry Mice, I couldn't get you to the cheese because ___"
- purpleCard[37]="I get by with a little help from ___"
- purpleCard[38]="I'm going on a diet this week. Nothing but organic cheese and ____"
- purpleCard[39]="Why am I Shaman?"
- purpleCard[40]="What's my super power?"
- purpleCard[41]="What's that smell?"
- purpleCard[42]="I got 99 problems but ______ ain't one."
- purpleCard[43]="What's that sound?"
- purpleCard[44]="What ended my last relationship?"
- purpleCard[45]="I am sorry professor, but I couldn't complete my homework because of ______."
- purpleCard[46]="______. That's how I want to die."
- purpleCard[47]="What are my parents hiding from me?"
- purpleCard[48]="What gets better with age?"
- purpleCard[49]="What have I got in my pocket?"
- purpleCard[50]="My teacher kinda looks like ______, don't you think?"
- purpleCard[51]="What do old people smell like?"
- purpleCard[52]="I am not going to lie. I despise _____. There, I said it."
- purpleCard[53]="Cancel all my meetings. We've got a situation with _____ that requires my immediate attention."
- purpleCard[54]="All men must like _____."
- purpleCard[55]="_____ cuts deeper than swords."
- purpleCard[56]="My worst nightmare is meeting ______ face to face."
- purpleCard[57]="Lovin' you is easy 'cause you're ______."
- purpleCard[58]="This is the prime of my life. I'm young, hot and full of ______."
- purpleCard[59]="How did you spend your weekend?"
- purpleCard[60]="Maybe she's born with it. Maybe it's ______."
- purpleCard[61]="When you are going to a comic convention, always bring ______."
- purpleCard[62]="There is no sense crying over every mistake, you just keep on trying 'til you run out of ______."
- purpleCard[63]="I'm not racist or anything, but I really don't like _____."
- purpleCard[64]="I can't sleep at night because of ______."
- greencard={}
- purplecard={}
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoTimeLeft(true)
- players = {}
- t = 0
- ban = {}
- maxPlayers2 = maxPlayers
- function banPlayer()
- for name in pairs(tfm.get.room.playerList) do
- if ban[name] then
- tfm.exec.killPlayer(name)
- for f = 500, 1500 do
- ui.removeTextArea(f , name)
- end
- end
- end
- end
- function firstToUpper(str)
- return (str:gsub("^%l", string.upper))
- end
- function eventNewPlayer(name)
- banPlayer()
- t = t + 1
- players[name] = { vote = 0 , score = 0}
- if not ban[name] then
- tfm.exec.respawnPlayer(name)
- end
- tfm.exec.setPlayerScore(name,0,false)
- 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)
- end
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- if maxPlayers > 9 then
- maxPlayers = 9
- end
- function cardsText()
- greencard = {}
- for k , v in pairs(greenCard) do
- greencard[k] = v
- end
- if finish then
- purplecard = {}
- for k , v in pairs(purpleCard) do
- purplecard[k] = v
- end
- round = 0
- maxr = 7
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name,0,false)
- players[name].score = 0
- end
- tfm.exec.newGame("@7111582")
- end
- end
- finish = true
- cardsText()
- function setJudger(name)
- Judger = name
- tfm.exec.killPlayer(name)
- tfm.exec.respawnPlayer(name)
- 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)
- local b = 0
- for f in pairs(tfm.get.room.playerList) do
- if players[f].vote == 1 then
- b = b + 1
- if b == maxPlayers and not chosen and not chosen2 then
- for c = 1, maxPlayers do
- ui.updateTextArea(ids[c] + 500,"<b><font size='12'>"..Player[c].."\n"..Idea[Player[c]].."</font></b>",nil)
- 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)
- end
- end
- end
- end
- end
- function eventNewGame()
- maxPlayers = maxPlayers2
- banPlayer()
- if t > maxPlayers then
- round = round + 1
- if round == maxr then
- 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)
- else
- 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)
- end
- ui.addTextArea(1, "<p align = 'center'><b><font size='14' face='impact'>♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦</font></b></p>", nil, 301, 34, 200, 120, 0x952cd1, 0x212f36, 1, move)
- 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)
- i = 0
- 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)
- else
- 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)
- end
- xx = 0
- getplace = {}
- y = 0
- start2 = false
- finish = false
- countdown = 2
- newround = 7
- ids = {}
- Judger = ""
- Judge = {}
- won = ""
- chosen = false
- chosen2 = false
- newgame2 = 13
- newgame = 5
- cards = {}
- Player = { }
- Idea = {}
- end
- function eventPlayerDied(name)
- if not ban[name] then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventPlayerWon(name)
- if not ban[name] then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventChatCommand(name, message)
- if message == "join" and Player[name] == nil and t > maxPlayers and not ban[name] then
- for q = 1 , maxPlayers + 1 do
- if getplace[q] then
- Player[q] = name
- Player[name] = q
- getplace[q] = false
- if i < maxPlayers then
- i = i + 1
- else
- local x = 0
- for s = q + (4 * (q - 1) ) , 5 * q do
- 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)
- x = x + 150
- end
- end
- end
- if q == maxPlayers + 1 and Player[name] == nil and i < maxPlayers then
- i = i + 1
- Player[name] = i
- Player[i] = name
- 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)
- end
- end
- end
- if i == maxPlayers then
- startGame1()
- i = i + 1
- end
- if message == "new" and admins[name] and i == maxPlayers + 1 and t > maxPlayers and not chosen and not chosen2 and not ban[name] then
- setJudger(Judge[math.random(1 , #Judge)])
- end
- if message == "restart" and admins[name] and not ban[name] then
- chosen2 = true
- newgame2 = 0
- end
- if message == "mods" then
- local mod = ""
- for playermod in pairs(tfm.get.room.playerList) do
- if admins[playermod] then
- mod = ""..mod..""..playermod..", "
- end
- end
- ui.addPopup(0,0,"<b><font size='20' color='#00E4E7'>The admins are:</font>\n"..mod.."",name,100,50,600,true)
- end
- if message == "help" then
- 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)
- end
- if message == "commands" and not admins[name] then
- 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)
- end
- if message == "commands" and admins[name] then
- 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)
- end
- local IDList = {}
- if message=="clear" and not ban[name] then
- for id, object in pairs(tfm.get.room.objectList) do
- table.insert(IDList, id)
- end
- for i, id in pairs(IDList) do
- tfm.exec.removeObject(id)
- end
- end
- if message == "s" and admins[name] and not ban[name] then
- tfm.exec.setShaman(name)
- end
- local message_args = {}
- for arg in message:gmatch("[^%s]+") do
- table.insert(message_args, arg)
- end
- if message_args[2] ~= nil then
- if message_args[1] == "ban" and admins[name] and not ban[name] then
- message_args[2] = firstToUpper(message_args[2])
- ban[message_args[2]] = true
- admins[message_args[2]] = false
- banPlayer()
- 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)
- eventPlayerLeft(message_args[2])
- end
- if message_args[1] == "admin" and admins[name] and not ban[name] then
- message_args[2] = firstToUpper(message_args[2])
- ban[message_args[2]] = false
- admins[message_args[2]] = true
- 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)
- end
- if message_args[1] == "unadmin" and admins[name] and not ban[name] then
- message_args[2] = firstToUpper(message_args[2])
- admins[message_args[2]] = false
- 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)
- end
- if message_args[1] == "unban" and admins[name] and not ban[name] then
- t = t + 1
- message_args[2] = firstToUpper(message_args[2])
- ban[message_args[2]] = false
- tfm.exec.respawnPlayer(message_args[2])
- 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)
- end
- 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
- message_args[2] = firstToUpper(message_args[2])
- if not ban[message_args[2]] then
- setJudger(message_args[2])
- end
- end
- if message_args[1] == "players" and admins[name] and not ban[name] then
- local number
- for yy = 0, 9 do
- if tostring(yy) == message_args[2] then
- number = tonumber(message_args[2])
- if number > 1 and number <= 9 then
- maxPlayers2 = number
- end
- end
- end
- end
- if message_args[1] == "setround" and admins[name] and not ban[name] then
- local number
- for yy = 0, 200 do
- if tostring(yy) == message_args[2] then
- number = tonumber(message_args[2])
- if number > 0 and number <= maxr then
- round = number - 1
- end
- end
- end
- end
- if message_args[1] == "maxround" and admins[name] and not ban[name] then
- local number
- for yy = 0, 200 do
- if tostring(yy) == message_args[2] then
- number = tonumber(message_args[2])
- if number > round then
- maxr = number
- end
- end
- end
- end
- end
- end
- function startGame1()
- if t > maxPlayers then
- local j = 0
- for name in pairs(tfm.get.room.playerList) do
- players[name].vote = 0
- if Player[name] == nil and not ban[name] then
- j = j + 1
- Judge[j] = name
- end
- end
- Judger = Judge[math.random(1 , #Judge)]
- tfm.exec.killPlayer(Judger)
- tfm.exec.respawnPlayer(Judger)
- 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)
- local e = math.random(1,#purplecard)
- while purplecard[e] == "" do
- e = math.random(1,#purplecard)
- end
- ui.addTextArea(1,"<b><font size='15'> "..purplecard[e].." </font></b>", nil, 301, 34, 200, 120, 0x952cd1, 0x212f36, 1, move)
- purplecard[e] = ""
- ui.removeTextArea(2, nil)
- for p = 1, maxPlayers do
- local x = 0
- for s = p + (4 * (p - 1) ) , 5 * p do
- n = math.random(1,#greencard)
- while greencard[n] == "" do
- n = math.random(1,#greencard)
- end
- cards[s] = greencard[n]
- 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)
- x = x + 150
- greencard[n] = ""
- end
- end
- end
- end
- function eventTextAreaCallback(id, name, cb)
- if cb == "card"..(id - 50).."" and players[name].vote == 0 and not ban[name] then
- Idea[name] = cards[id - 50]
- ids[Player[name]] = id
- 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)
- xx = xx + 150
- if xx == 750 then
- xx = (-27)
- y = ( -90 )
- end
- if y == -90 and xx == 273 then
- xx = 480
- end
- players[name].vote = 1
- local h = 0
- for name in pairs(tfm.get.room.playerList) do
- if players[name].vote == 1 then
- h = h + 1
- if h == maxPlayers then
- for a = 1, maxPlayers do
- ui.updateTextArea(ids[a] + 500,"<b><font size='12'>"..Player[a].."\n"..Idea[Player[a]].."</font></b>",nil)
- 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)
- end
- 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)
- start2 = true
- end
- end
- end
- ui.removeTextArea(id, nil)
- end
- if start2 then
- for winner in pairs(tfm.get.room.playerList) do
- if cb==winner and name == Judger and not chosen and not chosen2 then
- won = winner
- if round == maxr then
- 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)
- ui.updateTextArea(ids[Player[winner]] + 500,"<b><font size='12' color='#ff0000'>"..winner.."\n"..Idea[winner].."</font></b>",nil)
- tfm.exec.setPlayerScore(winner,10,true)
- players[winner].score = players[winner].score + 1
- chosen2 = true
- else
- 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)
- ui.updateTextArea(ids[Player[winner]] + 500,"<b><font size='12' color='#ff0000'>"..winner.."\n"..Idea[winner].."</font></b>",nil)
- tfm.exec.setPlayerScore(winner,10,true)
- players[winner].score = players[winner].score + 1
- chosen = true
- end
- end
- end
- end
- end
- function eventLoop()
- for name in pairs(tfm.get.room.playerList) do
- if ban[name] then
- 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)
- end
- end
- if t <= maxPlayers then
- 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)
- end
- if chosen then
- countdown = countdown - 1
- if countdown == 0 then
- newround = newround - 1
- 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)
- countdown = 2
- end
- if newround <= 0 then
- for f = 0, 1500 do
- ui.removeTextArea(f , nil)
- end
- eventNewGame()
- if repeatCards then
- cardsText()
- end
- end
- end
- if chosen2 then
- countdown = countdown - 1
- if countdown == 0 then
- newgame = newgame - 1
- newgame2 = newgame2 - 1
- countdown = 2
- end
- if newgame <= 0 then
- local key = -math.huge
- for name in pairs(tfm.get.room.playerList) do
- if players[name].score > key then
- key = players[name].score
- 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)
- end
- end
- end
- if newgame2 <= 0 then
- for f = 0, 1500 do
- ui.removeTextArea(f , nil)
- end
- finish = true
- cardsText()
- end
- end
- end
- function eventPlayerLeft(name)
- t = t - 1
- if not ban[name] then
- 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)
- end
- if name == Judger then
- while Judger == name do
- Judger = Judge[math.random(1 , #Judge)]
- tfm.exec.killPlayer(Judger)
- tfm.exec.respawnPlayer(Judger)
- end
- if ban[name] then
- 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)
- else
- 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)
- end
- end
- for q = 1 , maxPlayers do
- if name == Player[q] then
- if i < maxPlayers then
- i = i - 1
- end
- if players[name].vote == 0 then
- getplace[q] = true
- if not ban[name] then
- 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)
- else
- 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)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement