Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.newGame("@3699797")
- tfm.exec.setGameTime(600, true)
- debug.disableEventLog(true)
- adminNames = {"Finalnova","Shamousey"}
- GreenTeam = { }
- YellowTeam = { }
- RedTeam = { }
- BlueTeam = { }
- TeamDelay = os.time()
- TeamRound = os.time()
- RoundTime = 15000
- TeamRs = false
- TeamSc = 0
- --[[Question list]]--
- --[Вопрос, ответ]--
- Q = { }
- Q[0] = { "What colour is the sky?","Blue" }
- Q[1] = {"Who draws the art for Transformice?","Melibellule"}
- Q[2] = {"What is the chemical compound for regular water?","H20"}
- Q[3] = {"What year did Transformice open?","2010"}
- Q[4] = {"What was the predecessor game to Transformice called?","Poisson"}
- Q[5] = {"What\'s the name of the company that owns Transformice?","Atelier 801"}
- Q[6] = {"How many nipples do most people have?","2"}
- Q[6] = {"What\'s the name of the main developer for Transformice?","Tigrounette"}
- Q[7] = {"What\'s the name of Google\'s browser?","Chrome"}
- Q[8] = {"What physics engine is Transformice based on?","Box2D"}
- QMax = 8
- QCurrent = math.random(0,QMax)
- --[[Question list end]]--
- function eventNewGame()
- GreenTeam = { }
- YellowTeam = { }
- RedTeam = { }
- BlueTeam = { }
- TeamDelay = os.time()
- TeamRound = os.time()
- RoundTime = 15000
- TeamRs = false
- TeamSc = math.random(1,4)
- tfm.exec.chatMessage("<ROSE><B>A new round has started!</B>")
- end
- function eventLoop(time)
- --[[ Team placer ]]--
- if (TeamDelay + 5000 < os.time()) then
- for playerName,player in pairs(tfm.get.room.playerList) do
- if (player.x > 0 and player.x < 165) then
- tfm.exec.chatMessage("<T><b>You're on the green team.</b>",playerName)
- table.insert(GreenTeam,1,playerName)
- elseif (player.x > 165 and player.x < 365) then
- tfm.exec.chatMessage("<J><b>You're on the yellow team.</b>",playerName)
- table.insert(YellowTeam,1,playerName)
- elseif (player.x > 365 and player.x < 565) then
- tfm.exec.chatMessage("<R><b>You're on the red team.</b>",playerName)
- table.insert(RedTeam,1,playerName)
- elseif (player.x > 565 and player.x < 800) then
- tfm.exec.chatMessage("<BV><b>You're on the blue team.</b>",playerName)
- table.insert(BlueTeam,1,playerName)
- end
- end
- TeamDelay = os.time() + 600000
- TeamRs = true
- end
- --[[ What happens each round ]]--
- if TeamRs == true then
- if TeamSc == 1 then
- for index,playerName in pairs(GreenTeam) do
- tfm.exec.chatMessage("<T>It is your turn to answer a question.", playerName)
- tfm.exec.chatMessage("<ROSE><b>" ..Q[QCurrent][1].. "</b>", playerName)
- end
- elseif TeamSc == 2 then
- for index,playerName in pairs(YellowTeam) do
- tfm.exec.chatMessage("<J>It is your turn to answer a question.", playerName)
- tfm.exec.chatMessage("<ROSE><b>" ..Q[QCurrent][1].. "</b>", playerName)
- end
- elseif TeamSc == 3 then
- for index,playerName in pairs(RedTeam) do
- tfm.exec.chatMessage("<R>It is your turn to answer a question.", playerName)
- tfm.exec.chatMessage("<ROSE><b>" ..Q[QCurrent][1].. "</b>", playerName)
- end
- elseif TeamSc == 4 then
- for index,playerName in pairs(BlueTeam) do
- tfm.exec.chatMessage("<BV>It is your turn to answer a question.", playerName)
- tfm.exec.chatMessage("<ROSE><b>" ..Q[QCurrent][1].. "</b>", playerName)
- end
- end
- TeamRs = false
- TeamSc = TeamSc + 1
- if (TeamSc == 5) then
- TeamSc = 1
- end
- --[[ The time each round ]]--
- elseif (TeamRound + RoundTime < os.time()) then
- TeamRs = true
- TeamRound = os.time()
- end
- end
- function eventChat(name , command)
- command=command:lower()
- if command == 'help' then
- tfm.exec.chatMessage([[<J>Welcome to Team Quiz, this is a game where you have to answer questions with your team.]], name)
- end
- for index,playerName in pairs(adminNames) do
- if (command == 'newgame' and playerName == name) then
- tfm.exec.newGame('@3699797')
- tfm.exec.setGameTime(600, true)
- end
- if command == 'tgreen' then
- tfm.exec.movePlayer(playerName,91,330,0,0,0,0)
- end
- if command == 'tyellow' then
- tfm.exec.movePlayer(playerName,291,330,0,0,0,0)
- end
- if command == 'tred' then
- tfm.exec.movePlayer(playerName,491,330,0,0,0,0)
- end
- if command == 'tblue' then
- tfm.exec.movePlayer(playerName,691,330,0,0,0,0)
- end
- end
- if command == 'test' then
- for index,playerName in pairs(BlueTeam) do
- tfm.exec.chatMessage("It is your turn to answer a question.", playerName)
- end
- end
- end
- function eventNewPlayer(name)
- tfm.exec.chatMessage("<J><b>Welcome to Team Quiz, type</b> <ROSE><b>!help</b> <J><b>into the chat if you're stuck. This is not complete yet, so if it seems like features are missing, they probably are.</b>", name)
- end
Advertisement
Add Comment
Please, Sign In to add comment