Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ BAFFLUA MINIGAMES
- Vampire - A quick vampire survivor round, where vampires can fly.
- Dynamic Maze - A maze is made up of moving boxes, that mice have to try and maneuver around to get the cheese.
- Cheese Hunt - (You know what it is, it just doesn't seem to be doing well as its own room so making it a minigame might be good.)
- Dodge - Random items are shot from the ground upwards with a little warning, getting faster. Mice have to doge them so they don't die.
- Auto-survivor - Mice have to dodge the cannons that the shaman shoots at them (Baffbot style).
- Dive - The opposite of fly, tapping space will launch downards (think water maps).
- Shaman Fly - Whenever the shaman taps space, every mouse in the room gets launched up a little.
- Box Building - Pick up a box and place it down to build to the cheese (Baffbot style).
- Shooting Mice - Clicking on a mouse with an arrow will launch them in that direction.
- Bloon - Mice duck to get a balloon spawned which they can ride across.
- Simon - simon says use an emote!
- ]]
- --Prepwork
- debug.disableEventLog(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.setRoomMaxPlayers(5)
- admins={
- "Baffler", --noob girl
- "Fxie", --im a noob
- "Shamousey", --im #1
- "Begentle" --im also a noob
- }
- greets={
- "Hey qt *-*",
- "What's shakin bacon?",
- "Hey hot stuff, ready for a good time? ;)",
- "Go lick a duck and call yourself Shirley.",
- "OMG it's you!! kan i get your autografph?!",
- "If you touch my walrus one more time, I swear to god...",
- "Who are you and why are you sitting there?",
- "How you doin'? ;)"
- }
- games={
- --------------------------------------------------
- { name="Balance",
- time=15,
- shaman=false,
- intro="Don't rock the boat baby!",
- maps={"@3997635"},
- loop=function(time,remaining)
- if remaining<=1000 then
- tfm.exec.giveWinAll()
- end
- end
- },
- --------------------------------------------------
- { name="Bomb",
- time=30,
- delay=3,
- shaman=false,
- intro="Everyone is a bomb! KO the other team before they make it to your side of the map by pressing <VP>SPACE<J> to explode!",
- maps={"111"},
- prep=function()
- minigame.teams=makeTeams()
- for name,team in pairs(minigame.teams) do
- local red=name=="red"
- for i=1,#team,1 do
- tfm.exec.setNameColor(team[i],red and "0xEB1D51" or "0x2F7FCC")
- tfm.exec.movePlayer(team[i],red and 40 or 760,360,false,0,0,false)
- end
- end
- end,
- loop=function()
- for name,team in pairs(minigame.teams) do
- local red=name=="red"
- for i=1,#team,1 do
- local x=getPlayer(team[i]).x
- if (red and x>600) or (not red and x<200) then
- minigame.won=true
- tfm.exec.setGameTime(5)
- tfm.exec.chatMessage((red and "<R><b>Red" or "<BV><b>Blue").." team won thanks to "..team[i].."!</b>")
- for i=1,#team,1 do
- tfm.exec.giveWin(team[i])
- end
- end
- end
- end
- end,
- keys={
- SPACE=function(name,x,y)
- tfm.exec.killPlayer(name)
- tfm.exec.explosion(x,y,40,125,false)
- end
- }
- },
- --------------------------------------------------
- { name="Climb",
- time=60,
- shaman=false,
- intro="Reach the top of the map!",
- maps={"111"},
- prep=function()
- minigame.clouds={}
- end,
- loop=function()
- if minigame.clouds then
- local x=math.random(50,750)
- local y=math.random(75,300)
- local cloud=tfm.exec.addShamanObject(57,x,y)
- table.insert(minigame.clouds,cloud)
- if #minigame.clouds>=20 then
- tfm.exec.removeObject(minigame.clouds[1])
- table.remove(minigame.clouds,1)
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- if player.y>5 and player.y<=75 then
- tfm.exec.giveCheese(name)
- end
- end
- end
- },
- --------------------------------------------------
- { name="Dance",
- time=60,
- delay=5,
- shaman=true,
- intro="The shaman will give you a new direction every second! Keep up!",
- maps={"@580702"},
- prep=function()
- minigame.change=0
- minigame.dance=nil
- minigame.shaman=tfm.exec.getShaman()
- minigame.players={}
- for name,player in pairs(tfm.get.room.playerList) do
- minigame.players[name]={
- won=false,
- wrong=0,
- right=0
- }
- end
- end,
- loop=function()
- tfm.exec.movePlayer(minigame.shaman,400,140,false,0,-1,false)
- end,
- keys={
- DOWN=function(name,x,y)
- minigame.move(name,"DOWN",x,y)
- end,
- LEFT=function(name,x,y)
- minigame.move(name,"LEFT",x,y)
- end,
- RIGHT=function(name,x,y)
- minigame.move(name,"RIGHT",x,y)
- end
- },
- move=function(name,direction,x,y)
- if name==minigame.shaman then
- local timestamp=tonumber(os.time())
- if timestamp-minigame.change>2000 then
- minigame.change=timestamp
- minigame.dance=direction
- local rotate=direction=="DOWN" and 0 or direction=="LEFT" and 90 or direction=="RIGHT" and 270
- tfm.exec.addShamanObject(0,200,140,rotate)
- tfm.exec.addShamanObject(0,400,80,rotate)
- tfm.exec.addShamanObject(0,600,140,rotate)
- end
- elseif not minigame.players[name].won then
- elseif minigame.dance==direction then
- tfm.exec.setPlayerScore(name,1,true)
- minigame.players[name].right=minigame.players[name].right+1
- if minigame.players[name].right>=15 then
- minigame.players[name].won=true
- tfm.exec.chatMessage("<J><b>You got 15 right!</b> <VP>DUCK<J> to spawn a balloon!",name)
- end
- else
- minigame.players[name].wrong=minigame.players[name].wrong+1
- if minigame.players[name].wrong<3 then
- tfm.exec.chatMessage("<R>Way off!",name)
- else
- tfm.exec.killPlayer(name)
- tfm.exec.chatMessage("<R>Three strikes, you're out!",name)
- end
- end
- elseif direction=="DOWN" then
- tfm.exec.addShamanObject(28,x,y-90)
- tfm.exec.movePlayer(name,0,-120,true,0,-1,false)
- end
- end
- },
- --------------------------------------------------
- { name="Disco",
- time=15,
- shaman=false,
- intro="<ROSE>It's <b>party</b> time!!",
- maps={"@3926952"},
- prep=function()
- minigame.party={}
- end,
- loop=function()
- for name,player in pairs(tfm.get.room.playerList) do
- local colors={"0","4","8","C","F"}
- local currentColor="0x"
- for i=1,6,1 do
- currentColor=currentColor..table.random(colors)
- end
- tfm.exec.setNameColor(name,currentColor)
- if minigame.party[name] then
- tfm.exec.setPlayerScore(name,1,true)
- end
- end
- end,
- emote=function(name,emote)
- minigame.party[name]=emote==0 or nil
- end
- },
- --------------------------------------------------
- --[[
- { name="Fallout",
- time=60,
- shaman=false,
- intro="Random objects are falling from the sky! Look out!",
- maps={0}
- },
- ]]--
- --------------------------------------------------
- { name="FFA",
- time=60,
- delay=3,
- shaman=false,
- intro="You can shoot cannons by <VP>ducking<J>! Last mouse standing wins!",
- maps={521833,401421,541917,541928,541936,541943,527935,559634,559644,888052,878047,885641,770600,770656,772172,891472,589736,589800,589708,900012,901062,754380,901337,901411,892660,907870,910078,1190467,1252043,1124380,1016258,1252299,1255902,1256808,986790,1285380,1271249,1255944,1255983,1085344,1273114,1276664,1279258,1286824,1280135,1280342,1284861,1287556,1057753,1196679,1288489,1292983,1298164,1298521,1293189,1296949,1308378,1311136,1314419,1314982,1318248,1312411,1312589,1312845,1312933,1313969,1338762,1339474,1349878,1297154,644588,1351237,1354040,1354375,1362386,1283234,1370578,1306592,1360889,1362753,1408124,1407949,1407849,1343986,1408028,1441370,1443416,1389255,1427349,1450527,1424739,869836,1459902,1392993,1426457,1542824,1533474,1561467,1563534,1566991,1587241,1416119,1596270,1601580,1525751,1582146,1558167,1420943,1466487,1642575,1648013,1646094,1393097,1643446,1545219,1583484,1613092,1627981,1633374,1633277,1633251,1585138,1624034,1616785,1625916,1667582,1666996,1675013,1675316,1531316,1665413,1681719,1699880,1688696,623770,1727243,1531329,1683915,1689533,1738601,3756146},
- prep=function()
- minigame.lava=nil
- minigame.players={}
- for name,player in pairs(tfm.get.room.playerList) do
- minigame.players[name]={
- facing=1,
- cooldown=0
- }
- end
- end,
- loop=function(time,remaining)
- if alive==1 then
- local survivor=getAlivePlayers()[1]
- tfm.exec.chatMessage("<J><b>"..survivor.."</b> kicked butt!")
- tfm.exec.giveWin(survivor)
- elseif remaining<15000 then
- if not minigame.lava then
- minigame.lava=true
- tfm.exec.chatMessage("<J><b>Sudden death!!</b> Stay on screen!")
- else
- for name,player in pairs(tfm.get.room.playerList) do
- if player.y<0 or player.x<0 or player.x>800 then
- tfm.exec.killPlayer(name)
- end
- end
- end
- end
- end,
- keys={
- LEFT=function(name)
- minigame.players[name].facing=0
- end,
- RIGHT=function(name)
- minigame.players[name].facing=1
- end,
- DOWN=function(name,x,y)
- local timestamp=tonumber(os.time())
- if timestamp-minigame.players[name].cooldown>=1000 then
- minigame.players[name].cooldown=timestamp
- if minigame.players[name].facing==0 then
- tfm.exec.addShamanObject(20,x+10,y+15)
- else
- tfm.exec.addShamanObject(19,x-10,y+15)
- end
- end
- end
- }
- },
- --------------------------------------------------
- { name="Fly",
- time=60,
- shaman=false,
- intro="You can fly! Tap <VP>SPACE<J> to fly!",
- maps={'@1586626','@17944016','@871739','@1970001','@2439335','@367747','@3060750','@431721','@423670','@1578737','@923878','@1714548','@1578909','@1578851','@1578868','@1501237','@1224534','@1134543','@896157','@1134474','@999125','@999585','@891035','@926203','@764026','@717845','@577496','@573527','@197503','@2227644','@3054424','@436128','@1196336','@3008334','@1622242','@2113338','@379805','@187088','@421185','@164663','@335361','@146615','@186695','@181261','@201606','@155415','@455094','@433483','@294500','@318970','@211248','@180035','@3731774','@3599104','@3494281'},
- keys={
- SPACE=function(name)
- tfm.exec.movePlayer(name,0,0,true,0,-50,true)
- end
- }
- },
- --------------------------------------------------
- { name="Hill",
- time=30,
- shaman=false,
- intro="Don't fall off!",
- maps={"@3998037","@4025101"},
- loop=function(time,remaining)
- if alive==1 or remaining<=1000 then
- tfm.exec.giveWinAll()
- end
- end
- },
- --------------------------------------------------
- { name="Launch",
- time=60,
- shaman=true,
- intro="Click on mice with rotated arrows to launch them!",
- maps={"#4"},
- summoned=function(name,object,x,y,angle)
- if object==0 then
- for name,player in pairs(tfml.get.room.playerList) do
- if pythag(x,y,30,player.x,player.y,30) then
- local xv=Math.cos(angle)*10
- local yv=Math.sin(angle)*10
- tfm.exec.movePlayer(name,0,0,false,xv,yv,true)
- end
- end
- end
- end
- },
- --------------------------------------------------
- { name="Push",
- time=45,
- shaman=false,
- intro="Push the box off of the map!",
- maps={"@3995576","@425860","@3997537","@3997576"},
- boxes={{735,290},{91,194},{91,302},{118,212}},
- prep=function()
- local box=minigame.boxes[minigame.mapIndex]
- minigame.box=tfm.exec.addShamanObject(1,box[1],box[2])
- end,
- loop=function()
- local box=tfm.get.room.objectList[minigame.box]
- if box and box.y>400 or box.x>800 or box.x<0 then
- minigame.won=true
- tfm.exec.setGameTime(15)
- tfm.exec.chatMessage("<J>You sure showed that box!")
- for name,player in pairs(tfm.get.room.playerList) do
- minigame.box=nil
- if math.abs(box.x-player.x)<90 then
- tfm.exec.giveCheese(name)
- else
- tfm.exec.killPlayer(name)
- end
- end
- end
- end
- },
- --------------------------------------------------
- { name="Simon",
- time=30,
- shaman=false,
- intro="Simon says...",
- maps={"0"},
- prep=function()
- minigame.simon=nil
- minigame.switch=0
- end,
- loop=function(time,remaining)
- local timestamp=tonumber(os.time())
- if timestamp-minigame.switch>=2000 then
- minigame.switch=timestamp
- local says={"Dance","Laugh","Cry","Kiss","Rage","Clap","Sleep","Facepaw","Sit","Throw confetti"}
- minigame.simon=math.random(1,#says)-1
- tfm.exec.chatMessage("<V>[Simon] <CH><b>"..says[minigame.simon+1].."!</b>")
- end
- end,
- emote=function(name,emote)
- if emote==minigame.simon then
- tfm.exec.setPlayerScore(name,1,true)
- else
- tfm.exec.killPlayer(name)
- tfm.exec.chatMessage("<span color='#F0A78E'>[<b>Simon</b>] I didn't say do that!</span>",name)
- end
- end
- },
- --------------------------------------------------
- { name="Smash",
- time=60,
- shaman=true,
- intro="The shaman can throw mice! Beware, little girls!",
- maps={"#10"},
- loop=function(time,remaining)
- if remaining<=1000 then
- minigame.won=true
- for name,player in pairs(tfm.get.room.playerList) do
- if not player.isDead and not player.isShaman then
- tfm.exec.giveWin(name)
- end
- end
- elseif alive==1 then
- tfm.exec.giveWinAll()
- end
- end,
- summon=function(name,object,x,y,angle)
- if object==24 then
- if minigame.selected then
- local xOffset=x-minigame.xClick
- local yOffset=y-minigame.yClick
- tfm.exec.movePlayer(minigame.selected,0,0,true,xOffset,yOffset,true)
- minigame.selected=nil
- else
- for name,player in pairs(tfm.get.room.playerList) do
- if pythag(x,y,30,player.x,player.y,30) then
- minigame.selected=name
- minigame.xClick=x
- minigame.yClick=y
- break
- end
- end
- end
- end
- end
- },
- --------------------------------------------------
- { name="Spiritjump",
- time=30,
- shaman=false,
- intro="<VP>DUCK<J> to spiritjump!",
- maps={"#7"},
- keys={
- DOWN=function(name,x,y)
- tfm.exec.addShamanObject(24,x,y+15)
- end
- }
- },
- --------------------------------------------------
- { name="Teleport",
- time=60,
- shaman=true,
- intro="The shaman can spawn portals anywhere with arrows!",
- maps={"#4"},
- prep=function()
- minigame.portal=-1
- end,
- summoned=function(name,object,x,y,angle)
- if object==0 then
- minigame.portal=minigame.portal*-1
- tfm.exec.addShamanObject(minigame.portal==1 and 26 or 27,x,y)
- end
- end
- },
- --------------------------------------------------
- { name="Trivia",
- time=30,
- shaman=false,
- intro="Choices will appear every 5 seconds, <VP>DUCK<J> to choose the current one!",
- maps={0},
- trivia={
- { q="Who created Transformice?",
- a={ "Humans",
- "Mice",
- "Someone",
- "Nobody"
- }
- },
- { q="Who made Bafflua?",
- a={ "Fxie and her sidekick Shamousey",
- "Fxie",
- "Shamousey",
- "Baffler"
- }
- },
- { q="What is Lua?",
- q={ "A language from Brazil",
- "The thing Transformice uses for minigames",
- "The Earth's moon",
- "A good scripting language"
- }
- },
- { q="Would you consider this a question.",
- a={ "No",
- "Yes",
- "There is no question and therefor no answer",
- "<no answer>"
- }
- },
- { q="What sound does a mouse make?",
- a={ "Squeak",
- "Meep",
- "*-*",
- "Moo"
- }
- },
- { q="Did Baffbot wear an afro?",
- a={ "He wore glasses",
- "No",
- "Yes",
- "It depends on your definition of afro"
- }
- },
- { q="Which answer is the correct one?",
- a={ "Every answer is both right and wrong",
- "This one!",
- "This one, the others are false",
- "Either A, B, C, or D."
- }
- },
- { q="How long is a week?",
- a={ "Weeks do not have a length",
- "7 days",
- "5 days",
- "It depends if it's a work week"
- }
- },
- { q="What color are my socks?",
- a={ "What socks?",
- "Pink polka-dot",
- "Translucent",
- "I don't know!"
- }
- },
- { q="Choose your answer.",
- a={ "<no answer>",
- "No",
- "The answer is yes",
- "This is the correct answer"
- }
- },
- { q="Is the cup half full or half empty?",
- a={ "The cup is entirely empty",
- "It's half full",
- "It's half empty",
- "I'm not playing your mind games"
- }
- },
- { q="If a tree falls in a forest and no one is around to hear it, does it make a sound?",
- a={ "It depends",
- "No, because someone must exist to decide what is and is not sound",
- "Yes, because the mice can hear it",
- "Maybe, depending if less self-important animals are around"
- }
- }
- },
- prep=function()
- local q=table.random(minigame.trivia)
- local aTemp={}
- minigame.a=q.a[1]
- minigame.on=nil
- for i=1,#q.a,1 do
- table.insert(aTemp,q.a[i])
- end
- minigame.aList={}
- for i=1,#aTemp,1 do
- local index=math.random(#aTemp)
- table.insert(minigame.aList,aTemp[index])
- table.remove(aTemp,index)
- end
- tfm.exec.chatMessage("<ROSE>[<b>Question</b>] "..q.q)
- timer=system.newTimer(function()
- minigame.on=minigame.aList[1]
- tfm.exec.chatMessage("<J><b>A.</b> "..minigame.on)
- timer=system.newTimer(function()
- minigame.on=minigame.aList[2]
- tfm.exec.chatMessage("<J><b>B.</b> "..minigame.on)
- timer=system.newTimer(function()
- minigame.on=minigame.aList[3]
- tfm.exec.chatMessage("<J><b>C.</b> "..minigame.on)
- timer=system.newTimer(function()
- minigame.on=minigame.aList[4]
- tfm.exec.chatMessage("<J><b>D.</b> "..minigame.on)
- end,5000)
- end,5000)
- end,5000)
- end,5000)
- end,
- keys={
- DOWN=function(name,x,y)
- if minigame.on==minigame.a then
- tfm.exec.chatMessage("<J><b>"..name.."</b> knew the answer!")
- tfm.exec.giveWin(name)
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.killPlayer(name)
- end
- else
- tfm.exec.chatMessage("<R>WRONG!",name)
- tfm.exec.killPlayer(name)
- end
- end
- }
- },
- --------------------------------------------------
- { name="Walljump"
- time=60,
- shaman=false,
- intro="Walljump to stay alive!",
- maps={"@4025303"},
- loop=function(time,remaining)
- if time>5000 then
- local gravity=(time-5000)/5000
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.movePlayer(name,0,0,false,0,gravity,true)
- end
- elseif alive==1 or remaining<=1000 then
- tfm.exec.giveWinAll()
- end
- end,
- }
- }
- --Readable keys to playable keys
- for i=1,#games,1 do
- local mini=games[i]
- if mini.keys then
- local newKeys={}
- for key,fnc in pairs(mini.keys) do
- if key=="SPACE" then
- newKeys[32]=fnc
- elseif key=="UP" then
- newKeys[38]=fnc
- newKeys[87]=fnc
- elseif key=="DOWN" then
- newKeys[40]=fnc
- newKeys[83]=fnc
- elseif key=="LEFT" then
- newKeys[37]=fnc
- newKeys[64]=fnc
- newKeys[81]=fnc
- elseif key=="RIGHT" then
- newKeys[39]=fnc
- newKeys[68]=fnc
- end
- end
- mini.keys=newKeys
- end
- end
- --Useful.lua
- function table.random(table)
- return table[math.random(1,#table)]
- end
- function table.contains(table,element)
- for key,value in pairs(table) do
- if value==element then
- return true
- end
- end
- return false
- end
- --Useful.tfm
- function tfm.exec.giveWin(name)
- tfm.exec.giveCheese(name)
- tfm.exec.playerVictory(name)
- end
- function tfm.exec.giveWinAll()
- for name,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- tfm.exec.giveWin(name)
- end
- end
- end
- function tfm.exec.getShaman()
- for name,player in pairs(tfm.get.room.playerList) do
- if player.isShaman then
- return name
- end
- end
- end
- function getPlayer(name)
- return tfm.get.room.playerList[name]
- end
- function getAlivePlayers()
- local alivePlayers={}
- for name,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- table.insert(alivePlayers,name)
- end
- end
- return alivePlayers
- end
- function makeTeams(fncRed,fncBlue)
- local players={}
- local teams={
- red={},
- blue={}
- }
- for name,player in pairs(tfm.get.room.playerList) do
- table.insert(players,name)
- end
- for i=1,#players,1 do
- local index=math.random(#players)
- local player=players[index]
- if i%2==0 then
- if fncRed then fncRed() end
- table.insert(teams.red,player)
- else
- if fncBlue then fncBlue() end
- table.insert(teams.blue,player)
- end
- table.remove(players,index)
- end
- return teams
- end
- --Collision detection (circles)
- function pythag(x1,y1,r1,x2,y2,r2)
- local x=x2-x1
- local y=y2-y1
- local r=r2+r1
- return x*x+y*y<r*r
- end
- --Marblecake AKA The Game
- lastmode=-1
- function switchGame(mode,map)
- if timer then
- system.removeTimer(timer)
- timer=nil
- end
- setAllKeys(false)
- while not mode do
- mode=math.random(#games)
- if mode==lastmode then mode=nil end
- end
- lastmode=mode
- minigame=games[mode]
- if minigame.delay then
- minigame.ready=false
- else
- setAllKeys(true)
- end
- minigame.won=false
- tfm.exec.disableAutoShaman(not minigame.shaman)
- minigame.mapIndex=math.random(#minigame.maps)
- minigame.mapCode=map or minigame.maps[minigame.mapIndex]
- tfm.exec.newGame(minigame.mapCode)
- end
- --New game initialisation
- function eventNewGame()
- tfm.exec.setGameTime(minigame.time)
- tfm.exec.chatMessage("<J>"..minigame.intro)
- alive=0
- for name,player in pairs(tfm.get.room.playerList) do
- alive=alive+1
- if not player.isShaman then
- tfm.exec.setNameColor(name,0)
- end
- end
- if minigame.prep then minigame.prep() end
- end
- --Events
- function eventLoop(time,remaining)
- if minigame.delay and not minigame.ready and time>minigame.delay*1000 then
- minigame.ready=true
- setAllKeys(true)
- elseif not minigame.won and minigame.loop and (not minigame.delay or minigame.ready) then
- minigame.loop(time,remaining)
- end
- if remaining<=0 or alive==0 then
- switchGame()
- end
- end
- --Keyboard functions
- function setAllKeys(active)
- if minigame and minigame.keys then
- for key,fnc in pairs(minigame.keys) do
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(name,key,true,active)
- end
- end
- end
- end
- function eventKeyboard(name,key,down,x,y)
- if not getPlayer(name).isDead and minigame.keys then
- for code,fnc in pairs(minigame.keys) do
- if key==code then
- fnc(name,x,y)
- end
- end
- end
- end
- --Emotional
- function eventEmotePlayed(name,emote)
- if minigame.emote then
- minigame.emote(name,emote)
- end
- end
- --Summoning functions
- function eventSummoningStart(name,object,x,y,angle)
- if minigame.summon then
- minigame.summon(name,object,x,y,angle)
- end
- end
- function eventSummoningEnd(name,object,x,y,angle)
- if minigame.summoned then
- minigame.summoned(name,object,x,y,angle)
- end
- end
- function eventPlayerDied(name)
- alive=alive-1
- end
- function eventPlayerWon(name)
- alive=alive-1
- end
- --Chat commands
- system.disableChatCommandDisplay("help")
- system.disableChatCommandDisplay("games")
- system.disableChatCommandDisplay("skip")
- system.disableChatCommandDisplay("cheese")
- system.disableChatCommandDisplay("kill")
- system.disableChatCommandDisplay("play")
- function eventChatCommand(name,message)
- local split=string.find(message," ") or #message+1
- local cmd=string.sub(message,1,split-1)
- local args=string.sub(message,split+1)
- if cmd=="help" then
- tfm.exec.chatMessage("U NEED SUM HELP?!",name)
- elseif cmd=="games" then
- local list="<J>Current minigames: "
- for i=1,#games,1 do
- list=list.."<b>"..games[i].name.."</b>, "
- end
- tfm.exec.chatMessage(list.."and who knows what else!",name)
- elseif table.contains(admins,name) then
- if cmd=="skip" or cmd=="next" then
- switchGame()
- elseif cmd=="cheese" then
- tfm.exec.giveCheese(name)
- elseif cmd=="kill" then
- tfm.exec.killPlayer(args)
- elseif cmd=="play" then
- for i=1,#games,1 do
- if games[i].name==args then
- tfm.exec.setPlayerScore(name,100,true)
- switchGame(i)
- break
- end
- end
- end
- end
- end
- --Geral á minha humilde morada
- function eventNewPlayer(name)
- tfm.exec.chatMessage("<ROSE><b>"..table.random(greets).."</b>",name)
- end
- --Bafflua é online!
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- switchGame()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement