Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = { "Tectoon", "Theapps", "Sagazgamer" }
- players = {Sagazgamer}
- spectators = {}
- bscore = 0
- rscore = 0
- wait = 0
- endScore = 20
- winner = false
- newgame = false
- pause = false
- words = {"blue", "red", "score", "reset", "pause", "map"}
- owners = {Tectoon = true, Sagazgamer = true}
- function eventNewGame()
- tfm.exec.disableAutoTimeLeft(true)
- if newgame == true then
- rscore = 0
- bscore = 0
- newgame = false
- end
- if tfm.get.room.currentMap ~= "@2643833" then
- tfm.exec.setUIMapName("<font color='#10CAC5'>Up to ".. endScore)
- end
- ui.updateTextArea(1, "<b><font size='16'><p align='center'><font color = '#030597'>".. bscore .. " <N>- <font color = '#9C0202'>"..rscore)
- winner = false
- wait = 6
- for name in pairs(tfm.get.room.playerList) do
- if players[name].spectator == true then
- tfm.exec.killPlayer(name)
- elseif players[name].blueteam == true then
- tfm.exec.setNameColor(name, 0x056CF2)
- elseif players[name].redteam == true then
- tfm.exec.setNameColor(name, 0xC90000)
- end
- end
- end
- function victory(team)
- tfm.exec.newGame("@2643833")
- tfm.exec.setGameTime(30)
- tfm.exec.setUIMapName("<ROSE>GO ".. team)
- if team == "BLUE" then
- for name in pairs(tfm.get.room.playerList) do
- if players[name].redteam == true then
- tfm.exec.killPlayer(name)
- end
- if players[name].spectator == true then
- tfm.exec.killPlayer(name)
- end
- if players[name].blueteam == true then
- tfm.exec.setNameColor(name, 0x056CF2)
- end
- end
- end
- if team == "RED" then
- for name in pairs(tfm.get.room.playerList) do
- if players[name].blueteam == true then
- tfm.exec.killPlayer(name)
- end
- if players[name].spectator == true then
- tfm.exec.killPlayer(name)
- end
- if players[name].redteam == true then
- tfm.exec.setNameColor(name, 0xC90000)
- end
- end
- end
- end
- function eventPlayerLeft(name)
- players[name] = nil
- end
- function eventPlayerWon(name)
- if winner == false then
- winner = true
- if players[name].blueteam == true and pause == false then
- bscore = bscore + 1
- local totalb = endScore - bscore
- if totalb == 1 and bscore == rscore then
- endScore = endScore + 1
- tfm.exec.setUIMapName("<font color='#10CAC5'>Up to ".. endScore)
- elseif bscore >= endScore then
- tfm.exec.chatMessage("<BV>BLUE WINS!!!!!")
- victory("BLUE")
- else
- ui.updateTextArea(1, "<b><font size='16'><p align='center'><font color = '#030597'>".. bscore .. " <N>- <font color = '#9C0202'>"..rscore)
- end
- elseif players[name].redteam == true and pause == false then
- rscore = rscore + 1
- local totals = endScore - rscore
- if totals == 1 and rscore == bscore then
- endScore = endScore + 1
- tfm.exec.setUIMapName("<font color='#10CAC5'>Up to ".. endScore)
- elseif rscore >= endScore then
- tfm.exec.chatMessage("<R>RED WINS!!!!!")
- victory("RED")
- else
- ui.updateTextArea(1, "<b><font size='16'><p align='center'><font color = '#030597'>".. bscore .. " <N>- <font color = '#9C0202'>"..rscore)
- end
- end
- end
- end
- function eventNewPlayer(name)
- ui.addTextArea(1, "<b><font size='16'><p align='center'><font color = '#030597'>".. bscore .. " <N>- <font color = '#9C0202'>"..rscore, nil , 720, 20, 75, 23, 0x00001, nil, 0.2)
- tfm.exec.chatMessage("<J>Bem-vindo ao torneio racing!", name)
- players[name] = {
- spectator = true,
- blueteam = false,
- redteam = false
- }
- end
- function eventLoop()
- if tfm.get.room.currentMap == "@2643833" then
- wait = wait - 1
- if wait <= 0 and wait >= -30 then
- tfm.exec.addShamanObject(28, math.random()*800, math.random()*400)
- tfm.exec.addShamanObject(28, math.random()*800, math.random()*400)
- tfm.exec.addShamanObject(40, math.random()*800, math.random()*400)
- print(wait)
- if wait <= -5 and wait >= -7 then
- newgame = true
- end
- end
- end
- end
- function eventChatCommand(name, cmd)
- local args = {}
- for arg in cmd:gmatch("%S+") do
- table.insert(args, arg)
- end
- if owners[name] then
- if args[1] == "blue" and args[2] ~= nil then
- for n in pairs(tfm.get.room.playerList) do
- if n == args[2] and players[args[2]].blueteam == false then
- nom = args[2]
- end
- end
- if nom ~= nil then
- tfm.exec.setNameColor(nom, 0x056CF2)
- tfm.exec.chatMessage("<BV>Bem-vindo à equipe azul", nom)
- players[nom].blueteam = true
- players[nom].spectator = false
- if players[nom].redteam == true then
- players[nom].redteam = false
- end
- end
- elseif args[1] == "reset" then
- rscore = 0
- bscore = 0
- ui.updateTextArea(1, "<b><font size='16'><p align='center'><font color = '#030597'>".. bscore .. " <N>- <font color = '#9C0202'>"..rscore)
- for nam in pairs(tfm.get.room.playerList) do
- if tfm.get.room.playerList[nam] then
- tfm.exec.setNameColor(nam, 0)
- players[nam].blueteam=false
- players[nam].redteam=false
- players[nam].spectator=true
- end
- if nam == "Aeon" then
- players[nam].spectator=false
- end
- end
- tfm.exec.newGame()
- elseif args[1] == "pause" then
- pause = not pause
- if pause then
- tfm.exec.chatMessage("<BL>O jogo agora está em pausa.")
- else
- tfm.exec.chatMessage("<BL>O jogo é agora retomado.")
- end
- elseif args[1] == "map" then
- tfm.exec.newGame(tonumber(args[2]) or 3683520)
- elseif args[1] == "score" then
- endScore = tonumber(args[2] or 20) or 20
- tfm.exec.chatMessage("<ROSE>Você mudou a pontuação vencedora para: " .. endScore, name)
- tfm.exec.setUIMapName("<font color='#10CAC5'>Up to ".. endScore)
- elseif args[1] == "red" and args[2] ~= nil then
- for n in pairs(tfm.get.room.playerList) do
- if n == args[2] and players[args[2]].redteam == false then
- nom = args[2]
- end
- end
- if nom ~= nil then
- tfm.exec.setNameColor(nom, 0xC90000)
- tfm.exec.chatMessage("<R>Bem-vindo à equipe vermelha", args[2])
- players[nom].redteam = true
- players[nom].spectator = false
- if players[nom].blueteam == true then
- players[nom].blueteam = false
- end
- end
- end
- end
- end
- function table.delete(t, element)
- for key, value in ipairs(t) do
- if value == element then
- table.remove(t, key)
- end
- end
- end
- for i,p in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- end
- tfm.exec.disableAutoNewGame(true);
- mapas={[[@5515862]],[[@398041]],[[@1661852]],[[@3638794]],[[@1856349]],[[@1368233]],[[@3967250]],[[@4238784]],[[@4174318]],[[@3544895]],[[@229827]],[[@330590]],[[@211528]],[[@210188]],[[@5405469]],[[@5172709]],[[@3799507]],[[@3680180]],[[@214660]],[[@2577060]],[[@425797]],[[@314205]],[[@3901403]],[[@982242]],[[@508451]],[[@2813487]],[[@156510]],[[@606723]],[[@976721]],[[@3683294]],[[@3946626]],[[@332467]],[[@3845214]],[[@397501]],[[@3668754]],[[@1665516]],[[@3889414]],[[@3854268]],[[@1483155]],[[@2331474]],[[@3727755]],[[@266854]],[[@1646120]],[[@905496]],[[@3847244]],[[@278506]],[[@229834]],[[@220500]],[[@3721990]],[[@406266]],[[@1976857]],[[@301315]],[[@229944]],[[@217900]],[[@3684784]],[[@3696662]],[[@4685111]],[[@1654903]],[[@3630433]],[[@3620542]],[[@3617674]],[[@3603799]],[[@3556489]],[[@3556690]],[[@3572407]],[[@3537419]],[[@3584689]],[[@3347209]],[[@3267620]],[[@3209087]],[[@3156569]],[[@3036416]],[[@2953315]],[[@2883986]],[[@2725924]],[[@2683170]],[[@2682985]],[[@2645615]],[[@2588032]],[[@2586491]],[[@2564883]],[[@2536577]],[[@2453022]],[[@2393139]],[[@2372538]],[[@2287914]],[[@2286056]],[[@2228834]],[[@2223685]],[[@2219308]],[[@2214661]],[[@2185089]],[[@2174319]],[[@2150335]],[[@2144010]],[[@2138401]],[[@2134537]],[[@2118599]],[[@2101747]],[[@2079190]],[[@2076632]],[[@2068543]],[[@2048474]],[[@2047177]],[[@2023552]],[[@2018511]],[[@2012147]],[[@2007205]],[[@2007170]],[[@2005559]],[[@1987990]],[[@1982476]],[[@1979131]],[[@1976007]],[[@1975753]],[[@1975684]],[[@1975275]],[[@1973574]],[[@1965819]],[[@1964752]],[[@1964700]],[[@1956555]],[[@1956002]],[[@1954898]],[[@1954369]],[[@1705316]],[[@1862823]],[[@1862800]],[[@1794287]],[[@1924227]],[[@1923785]],[[@1687268]],[[@1716949]]};
- function nextRound()
- tfm.exec.newGame(mapas[math.random(#mapas)]);
- end
- function eventNewGame()
- vivo=0
- for name,player in pairs(tfm.get.room.playerList) do
- vivo=vivo+1
- end
- end
- for i in pairs(tfm.get.room.playerList) do
- end
- function eventPlayerDied(name)
- vivo=vivo-1
- end
- function eventPlayerWon(name)
- vivo=vivo-1
- end
- function eventLoop(tempoPassado, tempoFaltando)
- if vivo == 0 or tempoFaltando < 1000 then
- nextRound();
- end
- end
- nextRound();
- parametre = { ["Tempo automático"] = true }
- aff = { lJoueurs = {} , joueur = {}
- }
- joueur = {}
- for k, pseudo in pairs(admin) do
- ui.addTextArea (1, "<p align='center'><b><a href='event:time'>time</a></b></p>", pseudo, 60, 30, 35, 20, 0x324650, 0x324650, 0.75, true)
- ui.addTextArea (4, "<p align='center'><b><a href='event:map'>Mapa</a></b></p>", pseudo, 10, 30, 35, 20, 0x324650, 0x324650, 0.5, true)
- for l, m in pairs ( aff ) do
- aff[l][pseudo] = false
- end
- end
- function eventTextAreaCallback(id, source, callback)
- if callback == 'time' then
- ui.addPopup (0, 2, "Tempo para definir:", source, 10, 70, 150, true)
- elseif callback == 'map' then
- ui.addPopup (1, 2, "Código do Mapa::", source, 10, 70, 150, true)
- elseif parametre[callback] ~= nil then
- paraGestion(callback, source )
- ui.updateTextArea (id, callback .. ": <a href='event:" .. callback .. "'>" .. B(parametre[callback]) .. "</a>", source )
- elseif joueur[callback] ~= nil or callback == "Nomes" then
- if aff["joueur"][source] then
- effJoueur ( source )
- if callback ~= dernierProfil[source] then
- eventTextAreaCallback(id, source, callback)
- end
- else
- affJoueur(source, callback)
- ui.updateTextArea (id, "<p align='center'><b><V><a href='event:" .. callback .. "'>" .. callback .. "</a></N></b></p>", source)
- end
- dernierProfil[source] = callback
- elseif parametreJ[callback] ~= nil then
- if dernierProfil[source] == "all" then
- for k, v in pairs ( joueur ) do
- if all[callback] ~= nil then
- joueur[k][callback] = all[callback]
- end
- paraJGestion ( k, callback )
- end
- end
- end
- end
- function eventPopupAnswer (id, playerName, answer)
- if id == 0 then
- tfm.exec.setGameTime(answer, true)
- elseif id == 1 then
- tfm.exec.newGame(answer)
- end
- end
- print([[<font color="#FADE55"><b>[~Tribo Admin]</b></font> <N>Module carregado com sucesso!]]);
Advertisement
Add Comment
Please, Sign In to add comment