Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- winners={}
- banned={}
- data={}
- vivos=0;
- tempoMapa=0;
- cannons=false;
- sobreviventes=0;
- face="Soopafresh";
- size="120";
- game="#Dodge";
- color="#BABD2F";
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- function Data(playerName)
- data[playerName] = {
- tempoBanner=0;
- bannerOn=false;
- vitorias=0;
- alive=false;
- }
- end
- function isBanned(p)
- for _,player in pairs(banned) do
- if (player == p) then
- return true;
- end
- end
- return false;
- end
- function unBan(p)
- for num,k in ipairs(banned) do
- if (p == banned[num]) then
- table.remove(banned, num)
- end
- end
- end
- function Delete(p)
- for num,k in ipairs(winners) do
- if (p == winners[num]) then
- table.remove(winners, num)
- end
- end
- end
- function showBanner(p)
- data[p].tempoBanner=0;
- data[p].bannerOn=true;
- ui.addTextArea(1, "<BR><B><p align='center'><font face='"..face.."' size='"..size.."' color='#000000'><BR>"..game, p, 10, -30, 790, 400, 1, 1, 0.0, false)
- ui.addTextArea(2, "<BR><B><p align='center'><font face='"..face.."' size='"..size.."' color='#000000'><BR>"..game, p, 0, -30, 790, 400, 1, 1, 0.0, false)
- ui.addTextArea(3, "<BR><B><p align='center'><font face='"..face.."' size='"..size.."' color='#000000'><BR>"..game, p, 5, -35, 790, 400, 1, 1, 0.0, false)
- ui.addTextArea(4, "<BR><B><p align='center'><font face='"..face.."' size='"..size.."' color='#000000'><BR>"..game, p, 5, -25, 790, 400, 1, 1, 0.0, false)
- ui.addTextArea(5, "<BR><B><p align='center'><font face='"..face.."' size='"..size.."' color='"..color.."'><BR>"..game, p, 5, -30, 790, 400, 1, 1, 0.0, false)
- end
- function nextRound()
- for p in pairs(tfm.get.room.playerList) do
- data[p].alive=true;
- end
- vivos=0;
- cannons=false;
- tfm.exec.newGame('<C><P /><Z><S><S H="3000" L="60" o="FFFFFFFF" X="830" c="3" Y="200" T="12" P="0,0,0,0,0,0,0,0" /><S L="800" H="200" X="400" Y="480" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S H="34" L="760" o="0" X="400" c="4" Y="25" 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="18" o="0" X="18" c="4" Y="24" T="13" H="10" /><S c="4" L="18" o="0" X="782" H="10" Y="24" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S c="4" L="800" o="0" H="10" X="400" Y="20" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="365" X="400" /></D><O /></Z></C>')
- end
- function eventNewPlayer(p)
- Data(p)
- showBanner(p)
- end
- for p in pairs(tfm.get.room.playerList) do
- eventNewPlayer(p)
- end
- function eventNewGame()
- if sobreviventes == 1 then
- if data[winners[math.random(#winners)]].vitorias == 1 then
- ui.addTextArea(0, "<p align='center'><font size='14'><J>Último vencedor: <V>"..winners[#winners].."<J>, com <VP>"..data[winners[#winners]].vitorias.."<J> vitória!", NIL, 5, 22, 790, NIL, 1, 1, 0.0, true)
- elseif data[winners[math.random(#winners)]].vitorias >= 2 then
- ui.addTextArea(0, "<p align='center'><font size='14'><J>Último vencedor: <V>"..winners[#winners].."<J>, com <VP>"..data[winners[#winners]].vitorias.."<J> vitórias!", NIL, 5, 22, 790, NIL, 1, 1, 0.0, true)
- end
- elseif sobreviventes >= 2 then
- ui.removeTextArea(0, NIL)
- end
- for p in pairs(tfm.get.room.playerList) do
- vivos=vivos+1;
- end
- tfm.exec.setGameTime(180)
- tempoMapa=0;
- end
- function eventPlayerDied(p)
- data[p].alive=false;
- vivos=vivos-1;
- if vivos == 1 then
- for p in pairs(tfm.get.room.playerList) do
- if data[p].alive == true then
- data[p].vitorias=data[p].vitorias+1;
- ui.addTextArea(0, "<p align='center'><font size='14'><J>Parabéns, <V>"..p.."<J>! Você é o único sobrevivente!", NIL, 5, 22, 790, NIL, 1, 1, 0.0, true)
- table.insert(winners, p)
- cannons=false;
- sobreviventes=1;
- tfm.exec.setGameTime(5)
- end
- end
- end
- end
- function eventPlayerLeft(p)
- if data[p].alive == true then
- data[p].alive=false;
- vivos=vivos-1;
- end
- end
- function eventChatCommand(p, c)
- local args={}
- for arg in c:gmatch("[^%s]+") do
- table.insert(args,arg:lower())
- end
- if args[1] == "ban" then
- table.insert(banned, args[2])
- elseif args[1] == "unban" then
- unBan(args[2])
- ui.removeTextArea(9999, args[2])
- end
- system.disableChatCommandDisplay(c, true)
- end
- function eventLoop(ct, tr)
- for p in pairs(tfm.get.room.playerList) do
- if data[p].bannerOn == true then
- data[p].tempoBanner=data[p].tempoBanner+1;
- end
- end
- for p in pairs(tfm.get.room.playerList) do
- if data[p].tempoBanner == 10 then
- for i = 1,5 do
- ui.removeTextArea(i, p)
- end
- data[p].tempoBanner=0;
- data[p].bannerOn=false;
- end
- end
- if tr <= 0 then
- nextRound()
- elseif tr == 5 then
- if vivos > 1 then
- sobreviventes=2;
- end
- end
- for _,p in pairs(banned) do
- tfm.exec.killPlayer(p)
- ui.addTextArea(9999, "", p, -3000, -3000, 6800, 6400, 0x6A7495, 0x6A7495, 1.0, true)
- end
- if cannons == true then
- tfm.exec.addShamanObject(17, 820, math.random(150,380), math.random(-135, -45), 0, 0, false)
- end
- if tempoMapa == 5 then
- Delete(p)
- cannons=true;
- end
- if vivos == 1 then
- tfm.exec.setUIMapName("<J>#Dodge <G>| <N>Vivo: <V>"..vivos.."")
- else
- tfm.exec.setUIMapName("<J>#Dodge <G>| <N>Vivos: <V>"..vivos.."")
- end
- tempoMapa=tempoMapa+0.5;
- end
- nextRound()
Add Comment
Please, Sign In to add comment