Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- azul={[[JOGADORES DO AZUL = true]]}
- vermelho={[[JOGADORES DO VERMELHO = true]]}
- tfm.exec.disableAfkDeath(true)
- pontoazul=0;
- pontoverm=0;
- rod=0;
- pos=0;
- vivo=0;
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- system.disableChatCommandDisplay("tempo", true)
- system.disableChatCommandDisplay("resetrod", true)
- system.disableChatCommandDisplay("rod10", true)
- mapas={"1", "2", "6", "8", "14", "11", "19", "22", "55", "122", "121", "123", "70", "27", "28", "29", "@201606", "@191070", "@3637041", "@1162611", "@178657", "@1506007", "@2106576"}
- function eventNewGame()
- rod=rod+1;
- pos=0;
- vivo=0;
- vrod10(rod)
- tfm.exec.setGameTime(45)
- if rod == 1 and pontoazul > pontoverm then
- ui.addPopup(0, 0, "Parabéns, equipe azul! Você venceu com "..pontoazul.." pontos!", NIL, 350, 30, 200, true)
- elseif rod == 1 and pontoverm > pontoazul then
- ui.addPopup(0, 0, "Parabéns, equipe vermelha! Você venceu com "..pontoverm.." pontos!", NIL, 350, 30, 200, true)
- end
- if vermelho[playerName] == true then
- tfm.exec.setNameColor(playerName, 0xff0000)
- elseif azul[playerName] == true then
- tfm.exec.setNameColor(playerName, 0x0080ff)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- vivo=vivo+1
- end
- end
- function vrod10()
- if rod== 11 then
- rod=1;
- end
- end
- function nextRound()
- tfm.exec.newGame(mapas[math.random(#mapas)]);
- end
- function eventLoop(tempoPassado, tempoFaltando)
- if vivo == 0 or tempoFaltando <= 200 then
- nextRound();
- end
- tfm.exec.setUIMapName("<CH>Rodada: <V>"..rod.."/10 <BL> | <CH>Placar: <BL>"..pontoazul.." <J>X <R>"..pontoverm.."<BL>")
- if tempoFaltando >= 35000 and tempoFaltando <= 36000 and rod == 1 then
- pontoazul=0;
- pontoverm=0;
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name,0,false)
- end
- end
- end
- nextRound();
- function eventChatCommand(playerName,message)
- if message== "tempo" then
- ui.addPopup(0, 2, "Digite o tempo:", playerName, 350, 175, 100)
- end
- if message== "resetrod" then
- rod=0;
- tfm.exec.newGame(mapas[math.random(#mapas)]);
- end
- if message== "rod10" then
- rod=9;
- tfm.exec.newGame(mapas[math.random(#mapas)]);
- end
- end
- function eventPopupAnswer(id, player, answer)
- if id == 0 then
- tempo=answer
- end
- end
- function eventPlayerWon(playerName)
- pos=pos+1
- vivo=vivo-1
- if azul[playerName] == true then
- if pos == 1 then
- pontoazul=pontoazul+5
- tfm.exec.setPlayerScore(playerName,5,true)
- elseif pos == 2 then
- pontoazul=pontoazul+4
- tfm.exec.setPlayerScore(playerName,4,true)
- elseif pos == 3 then
- pontoazul=pontoazul+3
- tfm.exec.setPlayerScore(playerName,3,true)
- elseif pos == 4 then
- pontoazul=pontoazul+2
- tfm.exec.setPlayerScore(playerName,2,true)
- else
- pontoazul=pontoazul+1
- tfm.exec.setPlayerScore(playerName,1,true)
- end
- end
- if vermelho[playerName] == true then
- if pos == 1 then
- pontoverm=pontoverm+5
- tfm.exec.setPlayerScore(playerName,5,true)
- elseif pos == 2 then
- pontoverm=pontoverm+4
- tfm.exec.setPlayerScore(playerName,4,true)
- elseif pos == 3 then
- pontoverm=pontoverm+3
- tfm.exec.setPlayerScore(playerName,3,true)
- elseif pos == 4 then
- pontoverm=pontoverm+2
- tfm.exec.setPlayerScore(playerName,2,true)
- else
- pontoverm=pontoverm+1
- tfm.exec.setPlayerScore(playerName,1,true)
- end
- end
- end
- function eventPlayerDied(p)
- vivo=vivo-1
- end
- for name,player in pairs(tfm.get.room.playerList) do
- vivo=vivo+1
- tfm.exec.setPlayerScore(name,0,false)
- end
Advertisement
Add Comment
Please, Sign In to add comment