Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableDebugCommand(true)
- tfm.exec.disablePhysicalConsumables(true)
- tfm.exec.disableMortCommand(true)
- powerups={double=false,chuva=false,count=0,choosed="",bomba=false,objeto=false,explosion=false,fly=false,triple=false,invisible=false,selective=false}
- play_azul={}
- objetos={1,2,3,4,6,7,10,23,32,34,35,39,45,46,54,60,61,62,65,67,68,69,89,90,95}
- play_vermelho={}
- scoreloop=0
- sudden_death=false
- actual_player=""
- tempo=0
- players=0
- time_limit=10
- team=1
- kills=0
- data={}
- loop=8
- power=5
- valendo=false
- anvil_launched=false
- set=false
- object=10
- set_name=""
- reset=false
- count=0
- count_azul=0
- count_vermelho=0
- system.disableChatCommandDisplay("help")
- system.disableChatCommandDisplay("powerups")
- system.disableChatCommandDisplay("set")
- system.disableChatCommandDisplay("tc")
- system.disableChatCommandDisplay("limit")
- system.disableChatCommandDisplay("msg")
- system.disableChatCommandDisplay("p")
- system.disableChatCommandDisplay("rank")
- anvils={10,1002,1003,1004,1005}
- mapas={"@7467262","@7463118","@7436867","@7412348","@7467977","@7470456"}
- lang = {}
- lang.br = {
- win_vermelho = "<R><b>GG Time Vermelho!</b><br>A próxima partida será iniciada em 15 segundos.",
- win_azul = "<BL><b>GG Time Azul!</b><br>A próxima partida será iniciada em 15 segundos.",
- sudden_death = "<VP><b>Morte Súbita!</b><br>A equipe que conseguir eliminar qualquer um adversário será declarada a vencedora.",
- empate_text = "<J><b>Houve um empate!</b><br>A próxima partida será iniciada em 15 segundos.",
- instructions = "Use as teclas de 1 a 9 para alterar a potência da bigorna e barra de espaço para atirar. Para ajuda digite !help. Para ver poderes especiais digite !powerups.",
- turn = "<VP>É a vez de",
- timeout = "<J>Tempo esgotado! O atirador será alterado.",
- enter_vermelho = "Entrar no time vermelho",
- enter_azul = "Entrar no time azul",
- exit = "Sair do time",
- double = "acionou o powerup Bigorna Dupla!",
- double2 = "<br>Neste powerup, você atira 2 bigornas de uma vez.",
- triple = "acionou o powerup Bigorna Tripla!",
- triple2 = "<br>Neste powerup, você atira 3 bigornas de uma vez.",
- bomba1 = "acionou o powerup Bomba Relógio!",
- bomba2 = "<br>Neste powerup, uma explosão em um lugar aleatório do time adversário ocorrerá.",
- objeto1 = "acionou o powerup Tiro Aleatório!",
- objeto2 = "<br>Neste powerup, ao pressionar a barra de espaço, você vai atirar um objeto aleatório de shaman. Caso você tenha usado a habilidade Bigorna Dupla, você irá atirar 2 objetos ao invés de um.",
- exp1 = "acionou o powerup Olha a Explosão!",
- exp2 = "<br>Neste powerup, você pode gerar uma explosão clicando em um local do time inimigo.<br>Você possui 5 segundos para explodir!",
- chuva1 = "acionou o powerup Chuva de Objetos!",
- chuva2 = "<br>Neste powerup, ao atirar uma bigorna, irão aparecer diversos objetos continuamente até a troca de jogador.",
- fly1 = "acionou o powerup Modo Teleport!",
- fly2 = "<br>Neste powerup, enquanto você não atira uma bigorna, você poderá se teleportar clicando com o mouse.",
- inv1 = "acionou o powerup Modo Imortal!",
- inv2 = "<br>Neste powerup, você ficará imortal durante 4 turnos do seu time. Esta habilidade só pode ser utilizada uma vez por partida.",
- inv3 = "Sua habilidade Modo Imortal expirou.",
- invi1 = "acionou o powerup Bigorna Invisível!",
- invi2 = "<br>Neste powerup, você vai atirar uma bigorna invisível.<br>Este powerup não pode ser usado com as bigornas duplas e triplas.",
- selec1 = "acionou o powerup Objeto Seletivo!",
- selec2 = "<br>Neste powerup, você pode escolher um objeto para atirar ao invés de uma bigorna. Os preços variam de acordo com o objeto selecionado.",
- bar = "#anvilwar - Sala Temporária em Execução - Compilação 5020.055 efetuada em 16/07/2018<",
- intensity = "Intensidade",
- your_turn = "<J>É a sua vez de jogar. Pressione ESPAÇO para atirar e use as teclas de 1 a 9 para alterar a potência da bigorna. Use as teclas F1 a F10 para usar poderes especiais.",
- help = "Pressione ESPAÇO para atirar e use as teclas de 1 a 9 para alterar a potência da bigorna. Use as teclas de F1 a F10 para usar poderes especiais (para saber quais são, digite !powerups). A equipe que conseguir eliminar todos do time adversário vencerá a partida.<br><br>Script criado por Jessiewind26#2546, Jarvanfender#0000 e Jhinsword350#0000. Créditos a Vidaloka9999#0000 e Arenaut2000#0000 (tradução para o inglês).",
- enter = "Bem-vindos ao module Guerra de Bigornas! Digite !help para maiores informações.",
- teamkill1 = "Oh não! ",
- teamKill2 = "matou um companheiro de equipe",
- ajuda = "Ajuda",
- credits = "Créditos",
- mostrar = "Mostrar",
- seconds = "<ROSE>Faltam 60 segundos!",
- seconds30 = "<ROSE>Faltam 30 segundos!",
- seconds10 = "<ROSE>Faltam 10 segundos!",
- powerups1 = "F1 = Bigorna Dupla<br>F2 = Bigorna Tripla<br>F3 = Bomba Relógio<br>F4 = Tiro Aleatório<br>F5 = Olha a Explosão<br>F6 = Chuva de Objetos<br>F7 = Modo Teleport<br>F8 = Modo Imortal<br>F9 = Bigorna Invisível<br>F10 = Objeto Seletivo",
- powerups2 = "5pts<br>9pts<br>7pts<br>6pts<br>22pts<br>18pts<br>6pts<br>20pts<br>25pts<br>5pts",
- powerups3 = "<a href='event:power1'>Mostrar</a><br><a href='event:power2'>Mostrar</a><br><a href='event:power3'>Mostrar</a><br><a href='event:power4'>Mostrar</a><br><a href='event:power5'>Mostrar</a><br><a href='event:power6'>Mostrar</a><br><a href='event:power7'>Mostrar</a><br><a href='event:power8'>Mostrar</a><br><a href='event:power9'>Mostrar</a><br><a href='event:power10'>Mostrar</a>",
- teamchat = "<J>Você pode usar o comando !tc [mensagem] para falar apenas com o seu time.<br><br>Você pode ver seu perfil no jogo digitando !p e o ranking temporário digitando !rank.",
- menu_bar = "<p align='center'><a href='event:help'>Ajuda</a> | <a href='event:powerups'>Powerups</a> | <a href='event:profile'>Perfil</a> | <a href='event:ranking'>Ranking</a>",
- powerupslist = "Lista de Poderes",
- profile = "Use o comando !p para ver o seu perfil. Use !p [nome] para ver o perfil de outra pessoa.",
- starting = "<VP>A partida está prestes a começar. Preparem-se!"
- }
- lang.en = {
- win_vermelho = "<R><b>The RED team wins!</b><br>The next match will start on 15 seconds.",
- win_azul = "<BL><b>The BLUE team wins!</b><br>The next match will start on 15 seconds.",
- sudden_death = "<VP><b>SUDDEN DEATH!</b><br>The team that kill anyone of other team will won the match.",
- empate_text = "<J><b>There was a draw!</b><br>The next match will start on 15 seconds.",
- instructions = "Use the 1 to 9 keys to change the intensity of anvil and SPACEBAR to throw a anvil.",
- turn = "<VP>It's turn of",
- timeout = "<J>Time is over! The shooter will be changed.",
- enter_vermelho = "Enter on RED team",
- enter_azul = "Enter on BLUE team",
- exit = "Leave this team",
- double = "used the powerup Double Anvil!",
- triple = "used the powerup Triple Anvil!",
- bomba1 = "used the powerup Time Bomb!",
- bomba2 = "<br>On this powerup, a explosion will occur on a random place of enemy area.",
- objeto1 = "used the powerup Random Shoot!",
- objeto2 = "<br>On this powerup, you will shoot a random shaman object instead of a anvil. If you have used the Double Anvil powerup, you can shoot 2 objects instead of one.",
- exp1 = "used the powerup Explosion!",
- exp2 = "<br>On this powerup, you can cause a explosion clicking on enemy area with your mouse.<br>You have 5 seconds to cause your explosion.",
- chuva1 = "used the powerup Anvil Rain!",
- chuva2 = "<br>On this powerup, you will shoot several anvils",
- fly1 = "used the powerup Teleport Mode!",
- fly2 = "<br>On this powerup, you can teleport your mice using the mouse click.",
- inv1 = "used the powerup Immortal Mode!",
- inv2 = "<br>On this powerup, you be immortal during the next 4 turns. This powerup only can be used 1 time per game.",
- inv3 = "Your immortality has ended.",
- invi1 = "used the powerup Invisible Anvil!",
- invi2 = "<br>On this powerup, you will shoot a invisible anvil. This ability can't be used with double and triple anvils.",
- selec1 = "used the powerup Selective Object!",
- selec2 = "<br>On this powerup, you can select a shaman object to shoot instead of a anvil. This ability can't be used with double and triple anvils.",
- bar = "#anvilwar - Temporary Module Running - Compilation 5020.055 made on 07/16/2018<",
- intensity = "Intensity",
- your_turn = "<J>It's your turn to shoot. Press SPACEBAR to throw a anvil and use the 1 to 9 keys to change the intensity of anvil. Use the F1 to F10 keys to use powerups.",
- help = "Press SPACEBAR to throw a anvil and use the 1 to 9 keys to change the intensity of anvil. Use the F1 to F10 keys to use powerups (type !powerups). The team that eliminates the enemy team wons the game.<br><br>Script made by Jessiewind26#2546, Jarvanfender#0000 e Jhinsword350#0000. Credits to Vidaloka9999#0000 and Arenaut2000#0000 (English translation).",
- enter = "Welcome to Anvil War Module! Type !help to help.",
- teamkill1 = "Oh no! ",
- teamKill2 = "has killed a player of her team",
- seconds = "<ROSE>60 seconds remaining!",
- seconds30 = "<ROSE>30 seconds remaining!",
- seconds10 = "<ROSE>10 seconds remaining!",
- powerups1 = "F1 = Double Anvil<br>F2 = Triple Anvil<br>F3 = Time Bomb<br>F4 = Random Shoot<br>F5 = Explosion<br>F6 = Anvil Rain<br>F7 = Teleport Mode<br>F8 = Immortal Mode<br>F9 = Invisible Anvil<BR>F10 = Selective Object",
- powerups2 = "5pt<br>9pt<br>7pt<br>6pt<br>22pt<br>18pt<br>6pt<br>20pt<br>25pt<br>5pt",
- powerups3 = "<a href='event:power1'>Show</a><br><a href='event:power2'>Show</a><br><a href='event:power3'>Show</a><br><a href='event:power4'>Show</a><br><a href='event:power5'>Show</a><br><a href='event:power6'>Show</a><br><a href='event:power7'>Show</a><br><a href='event:power8'>Show</a><br><a href='event:power9'>Show</a><br><a href='event:power10'>Show</a>",
- teamchat = "<J>You can use the command !tc [message] to speak with your team.<br><br>You can see your profile typing !p and the temporary tanking typing !rank.",
- menu_bar = "<p align='center'><a href='event:help'>Help</a> | <a href='event:powerups'>Powerups</a> | <a href='event:profile'>Profile</a> | <a href='event:ranking'>Ranking</a>",
- powerupslist = "Powerups List",
- profile = "Use the !p command to view your profile and use !p [username] to view the profile of another user.",
- starting = "<VP>The match will start on a few seconds. Get ready!"
- }
- if tfm.get.room.community == "br" then
- text = lang.br
- else
- text = lang.en
- end
- function changeMap()
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- function resetPowers()
- ui.removeTextArea(701,nil)
- powerups.double=false
- powerups.objeto=false
- powerups.count=2
- kills=0
- powerups.bomba=false
- powerups.explosion=false
- powerups.chuva=false
- powerups.fly=false
- anvil_launched=false
- powerups.triple=false
- powerups.invisible=false
- powerups.selective=false
- set=false
- end
- changeMap()
- function split(t,s)
- local a={}
- for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
- table.insert(a,i)
- end
- return a
- end
- function eventRanking(name)
- local sc = {}
- for name, player in pairs(tfm.get.room.playerList) do
- sc[#sc+1] = {n=name,s=data[name].score,f=data[name].kills,d=data[name].kd}
- end
- table.sort(sc,function(a,b) return a.s>b.s end)
- str1 = ''
- str2 = ''
- str3 = ''
- str4 = ''
- for k,v in pairs(sc) do
- if k < 13 then
- if str ~= '' then
- str1=str1.."<br><N>"..k.."° | <VP>"..v.n..""
- str2=str2.."<br><b><N>"..v.s.."</b>"
- str3=str3.."<br><N>"..v.f..""
- str4=str4.."<br><N>"..v.d..""
- else
- str1="<J>"..k.."° | <VP>"..v.n..""
- str2="<J><b>"..v.s.."</b>"
- str3="<J>"..v.f..""
- str4="<J>"..v.d..""
- end
- end
- end
- ui.addTextArea(8000,'<B><J><font size="13"><p align="center">Ranking of Day',name,100,60,600,30,nil,0x2e424d,nil,true)
- ui.addTextArea(8001,"<B><font size='13'><font face='Consolas'># Name Score Kills Ratio%",name,110,90,580,20,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8002,"<B><font size='16'><font face='Consolas'>"..str1,name,110,110,580,240,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8003,"<p align='right'><font size='16'><font face='Consolas'>"..str2,name,420,110,60,240,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8004,"<p align='right'><font size='16'><font face='Consolas'>"..str3,name,500,110,60,240,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8005,"<p align='right'><font size='16'><font face='Consolas'>"..str4,name,610,110,45,240,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8006,"<p align='center'><font size='15'><R><a href='event:close'>Close</a>",name,300,360,190,20,0x3c5063,0x3c5063,nil,true)
- end
- function loadPowerups(name)
- ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>"..text.powerupslist.."",name,100,60,600,30,nil,0x2e424d,nil,true)
- ui.addTextArea(9001,"<font size='14'><font face='Consolas'>Powerup Name Score Funct.",name,110,90,580,20,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(9002,"<font size='14'><font face='Consolas'>"..text.powerups1.."",name,110,115,580,250,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(9003,"<font size='14'><font face='Consolas'>"..text.powerups2.."",name,420,115,60,250,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(9004,"<font size='14'><font face='Consolas'>"..text.powerups3.."",name,500,115,60,250,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(9006,"<font size='14'><R><a href='event:closep'>Close</a>",name,300,360,190,20,0x3c5063,0x3c5063,nil,true)
- end
- function eventChatCommand(name,message)
- local arg = split(message, " ")
- if arg[1] == "p" then
- if arg[2] then
- nome = arg[2]:lower():gsub('%a', string.upper, 1)
- else
- nome = name
- end
- if tfm.get.room.playerList[nome] then
- ui.addTextArea(8003,'<B><J><font size="17"><p align="center">'..nome,name,245,65,315,30,nil,0x2e424d,nil,true)
- ui.addTextArea(8004,"<font size='12'><b>Score: "..data[nome].score.."</b><br><br>Matchs played: "..data[nome].matchs.."<br>Kills: "..data[nome].kills.."<br>Wins: "..data[nome].wins.."<br>Max Killing Spree: "..data[nome].max.."<br>Multi Kills: "..data[nome].mks.."<br>Kills/Match: "..data[nome].kd.."%",name,255,95,290,120,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8005,"<R><p align='center'><B><a href='event:fechar'>Fechar</a>",name,255,220,290,20,0x3c5063,0x3c5063,nil,true)
- else
- tfm.exec.chatMessage("<R>"..nome.." isn't found in this room.</R>",name)
- end
- end
- if message == "rank" then
- eventRanking(name)
- end
- if(message:sub(0,4) == "kill") then
- if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
- tfm.exec.killPlayer(message:sub(6))
- end
- end
- if(message:sub(0,7) == "set_map") then
- if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
- tfm.exec.newGame(message:sub(9))
- end
- end
- if(message:sub(0,5) == "limit") then
- if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
- local limite=tonumber(message:sub(7))
- tfm.exec.chatMessage("Room mice limit: "..limite.."")
- tfm.exec.setRoomMaxPlayers(limite)
- end
- end
- if(message:sub(0,2) == "tc") then
- local typer=name
- if data[typer].team == "azul" then
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].team == "azul" then
- tfm.exec.chatMessage("<font color='#0080ff'>• ["..typer.."] "..message:sub(4).."",name)
- end
- end
- elseif data[typer].team == "vermelho" then
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].team == "vermelho" then
- tfm.exec.chatMessage("<font color='#ff8000'>• ["..typer.."] "..message:sub(4).."",name)
- end
- end
- end
- end
- if message == "reset" then
- if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
- changeMap()
- end
- end
- if(message:sub(0,3) == "set") then
- if name == "Jessiewind26#2546" or name == "Jarvanfender#0000" or name == "Jhinsword350#0000" then
- set_name=message:sub(5)
- set=true
- end
- end
- if message == "help" then
- tfm.exec.chatMessage(text.help,name)
- end
- if message == "powerups" then
- loadPowerups()
- end
- end
- function eventLoop(passado,faltando)
- local minutos=math.floor(tempo/60)
- local segundos=math.floor((minutos*60)-tempo) * -1
- if valendo == true and tempo < 60 and tempo > 59 and sudden_death == false then
- tfm.exec.chatMessage(text.seconds,nil)
- end
- if valendo == true and tempo < 30 and tempo > 29 and sudden_death == false then
- tfm.exec.chatMessage(text.seconds30,nil)
- end
- if valendo == true and tempo < 10 and tempo > 9 then
- tfm.exec.chatMessage(text.seconds10,nil)
- end
- if valendo == true and reset == false then
- tempo=tempo-0.5
- scoreloop=scoreloop+1
- if scoreloop >= 30 then
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].killed == 0 then
- tfm.exec.setPlayerScore(name,2,true)
- data[name].score=data[name].score+1
- end
- end
- scoreloop=0
- end
- end
- if anvil_launched == false and valendo == true then
- ui.addTextArea(501,"<font size='40'><p align='center'>"..math.floor(faltando/1000).."",actual_player,360,310,80,55,0x000001,0x000001,1.0,true)
- else
- ui.removeTextArea(501,actual_player)
- end
- if valendo == true and reset == false and tempo == 0 and sudden_death == true then
- if count_vermelho > count_azul then
- tfm.exec.chatMessage(text.win_vermelho)
- elseif count_vermelho < count_azul then
- tfm.exec.chatMessage(text.win_azul)
- else
- tfm.exec.chatMessage(text.empate_text)
- end
- count_azul=0
- count_vermelho=0
- valendo=false
- reset=true
- tfm.exec.setGameTime(15)
- end
- if reset == true then
- if faltando < 1 then
- changeMap()
- end
- end
- if valendo == true and reset == false and anvil_launched == false then
- time_limit=time_limit-0.5
- if time_limit == 0 then
- anvil_launched=true
- time_limit=15
- tfm.exec.chatMessage(text.timeout)
- end
- end
- if valendo == false and reset == false and faltando < 1888 and count_azul > 0 and count_vermelho > 0 then
- for i=11,297 do
- ui.removeTextArea(i,nil)
- end
- end
- if valendo == false and reset == false and faltando < 1 then
- if count_azul > 0 and count_vermelho > 0 then
- if count == 0 then
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.chatMessage(text.starting,name)
- if data[name].team == "azul" then
- data[name].matchs=data[name].matchs+1
- tfm.exec.respawnPlayer(name)
- tfm.exec.movePlayer(name,1000,160,false,0,0,false)
- table.insert(play_azul,name)
- tfm.exec.setPlayerScore(name,0,false)
- elseif data[name].team == "vermelho" then
- data[name].matchs=data[name].matchs+1
- tfm.exec.respawnPlayer(name)
- tfm.exec.movePlayer(name,600,160,false,0,0,false)
- table.insert(play_vermelho,name)
- tfm.exec.setPlayerScore(name,0,false)
- else
- tfm.exec.movePlayer(name,800,-1,false,0,0,false)
- tfm.exec.setPlayerScore(name,-1,false)
- kills=0
- end
- end
- end
- kills=0
- count=count+0.5
- if count >= 10 then
- tfm.exec.chatMessage(text.teamchat,nil)
- valendo=true
- players=count_azul+count_vermelho
- tempo=120+(players*8)
- for i=11,297 do
- ui.removeTextArea(i,nil)
- end
- if team == 2 then
- team=1
- if set == false then
- actual_player=play_vermelho[math.random(#play_vermelho)]
- else
- actual_player=set_name
- end
- else
- team=2
- if set == false then
- actual_player=play_azul[math.random(#play_azul)]
- else
- actual_player=set_name
- end
- end
- loop=10
- anvil_launched=false
- tfm.exec.setGameTime(15)
- time_limit=15
- if valendo == true and reset == false then
- tfm.exec.chatMessage(text.your_turn,actual_player)
- end
- end
- else
- tfm.exec.setGameTime(6)
- end
- end
- if valendo == true and anvil_launched == true then
- loop=loop-1
- if loop == 0 then
- if kills >= 3 then
- data[actual_player].mks=data[actual_player].mks+1
- end
- if not tfm.get.room.community == "br" then
- if kills == 2 then
- tfm.exec.chatMessage("<ROSE>Double Kill of "..actual_player.."!")
- elseif kills >= 3 then
- tfm.exec.chatMessage("<ROSE>Multi Kill: "..kills.." kills of "..actual_player.."!")
- end
- else
- if kills == 2 then
- tfm.exec.chatMessage("<ROSE>Double Kill de "..actual_player.."!")
- elseif kills >= 3 then
- tfm.exec.chatMessage("<ROSE>Multi Kill: "..kills.." kills de "..actual_player.."!")
- end
- end
- kills=0
- play_azul={}
- play_vermelho={}
- count_azul=0
- count_vermelho=0
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].team == "azul" then
- if data[name].killed == 0 then
- table.insert(play_azul,name)
- count_azul=count_azul+1
- end
- end
- if data[name].team == "vermelho" then
- if data[name].killed == 0 then
- table.insert(play_vermelho,name)
- count_vermelho=count_vermelho+1
- end
- end
- if data[name].immortal == true then
- data[name].imatchs=data[name].imatchs+1
- if data[name].imatchs >= 9 then
- data[name].immortal=false
- tfm.exec.chatMessage(text.inv3,name)
- tfm.exec.setNameColor(name,0xd7d7e6)
- end
- end
- end
- if team == 2 then
- team=1
- if set == false then
- actual_player=play_vermelho[math.random(#play_vermelho)]
- else
- actual_player=set_name
- end
- else
- team=2
- if set == false then
- actual_player=play_azul[math.random(#play_azul)]
- else
- actual_player=set_name
- end
- end
- loop=8
- resetPowers()
- if valendo == true and reset == false then
- if count_azul == 0 then
- winRed()
- tfm.exec.chatMessage(text.win_vermelho)
- valendo=false
- reset=true
- tfm.exec.setGameTime(15)
- elseif count_vermelho == 0 then
- winAzul()
- tfm.exec.chatMessage(text.win_azul)
- valendo=false
- reset=true
- tfm.exec.setGameTime(15)
- end
- end
- tfm.exec.setGameTime(15)
- time_limit=15
- if valendo == true and reset == false then
- tfm.exec.chatMessage(text.your_turn,actual_player)
- end
- end
- end
- if valendo == true and reset == false and tempo <= 0 and sudden_death == false and anvil_launched == false then
- if count_vermelho > count_azul then
- tfm.exec.chatMessage(text.win_vermelho)
- winRed()
- valendo=false
- reset=true
- tfm.exec.setGameTime(15)
- count_azul=0
- count_vermelho=0
- elseif count_vermelho < count_azul then
- tfm.exec.chatMessage(text.win_azul)
- winAzul()
- valendo=false
- reset=true
- tfm.exec.setGameTime(15)
- count_azul=0
- count_vermelho=0
- else
- tempo=60
- tfm.exec.setGameTime(60)
- tfm.exec.chatMessage(text.sudden_death)
- sudden_death=true
- end
- end
- if powerups.bomba == true then
- powerups.count=powerups.count+1
- if powerups.count == 3 then
- local x_position=0
- if data[actual_player].team == "azul" then
- x_position=math.random(100,750)
- tfm.exec.explosion(x_position,200,30,120,true)
- tfm.exec.displayParticle(12,x_position,200,0,0,0,0,nil)
- elseif data[actual_player].team == "vermelho" then
- x_position=math.random(850,1500)
- tfm.exec.explosion(x_position,200,30,120,true)
- tfm.exec.displayParticle(12,x_position,200,0,0,0,0,nil)
- end
- powerups.count=2
- powerups.bomba=false
- end
- end
- if powerups.chuva == true and anvil_launched == true then
- if data[actual_player].team == "azul" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],tfm.get.room.playerList[actual_player].x,tfm.get.room.playerList[actual_player].y-60,0,(4+power*2)*-1,-8)
- elseif data[actual_player].team == "vermelho" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],tfm.get.room.playerList[actual_player].x,tfm.get.room.playerList[actual_player].y-60,0,4+power*2,-8)
- end
- end
- if faltando < 15000 and faltando > 10000 and valendo == true and reset == false then
- if segundos < 10 then
- ui.addTextArea(14,"<p align='center'><font size='16'><font face='Consolas'>Time Remaining: <b>"..minutos..":0"..segundos.."</b> | Red <R>"..count_vermelho.." <N>X <BL>"..count_azul.." <N>Blue | Turn: <b>"..actual_player.."",nil,10,368,780,27,0x241224,0x160916,1.0,true)
- else
- ui.addTextArea(14,"<p align='center'><font size='16'><font face='Consolas'>Time Remaining: <b>"..minutos..":"..segundos.."</b> | Red <R>"..count_vermelho.." <N>X <BL>"..count_azul.." <N>Blue | Turn: <b>"..actual_player.."",nil,10,368,780,27,0x241224,0x160916,1.0,true)
- end
- else
- ui.removeTextArea(14,nil)
- end
- end
- function eventPlayerDied(name)
- if count < 10 then
- tfm.exec.respawnPlayer(name)
- if data[name].team == "azul" then
- tfm.exec.movePlayer(name,1000,160,false,0,0,false)
- elseif data[name].team == "vermelho" then
- tfm.exec.movePlayer(name,600,160,false,0,0,false)
- end
- end
- if data[name].immortal == false then
- if valendo == true and reset == false then
- if tfm.get.room.playerList[name].y > 50 then
- tfm.exec.setPlayerScore(name,-1,false)
- tfm.exec.setPlayerScore(actual_player,2,true)
- data[actual_player].kills=data[actual_player].kills+1
- data[actual_player].score=data[actual_player].score+5
- loop=loop+1
- data[name].killed=1
- kills=kills+1
- if kills > data[actual_player].max then
- data[actual_player].max=kills
- data[actual_player].score=data[actual_player].score+10
- end
- if data[name].team == data[actual_player].team and anvil_launched == true then
- tfm.exec.chatMessage("<J>"..text.teamkill1..""..actual_player.." "..text.teamKill2..": <b>"..name.."</b>.")
- tfm.exec.setPlayerScore(actual_player,-4,true)
- kills=kills-1
- data[actual_player].kills=data[actual_player].kills-1
- data[actual_player].score=data[actual_player].score-4
- end
- end
- end
- else
- tfm.exec.respawnPlayer(name)
- tfm.exec.setNameColor(name,0x00ff00)
- if data[name].team == "azul" then
- tfm.exec.movePlayer(name,1000,160,false,0,0,false)
- elseif data[name].team == "vermelho" then
- tfm.exec.movePlayer(name,600,160,false,0,0,false)
- end
- end
- if sudden_death == true then
- if data[name].team == "azul" and data[name].immortal == false then
- winRed()
- tfm.exec.chatMessage(text.win_vermelho)
- count_azul=0
- elseif data[name].team == "vermelho" and data[name].immortal == false then
- winAzul()
- tfm.exec.chatMessage(text.win_azul)
- count_vermelho=0
- end
- valendo=false
- reset=true
- tfm.exec.setGameTime(15)
- sudden_death=false
- end
- if actual_player == name then
- anvil_launched=true
- actual_palayer=""
- end
- end
- function eventPlayerLeft(name)
- ui.setMapName(text.bar)
- data[name].killed=-1
- data[name].team=""
- end
- function eventNewPlayer(name)
- ui.setMapName(text.bar)
- tfm.exec.chatMessage(text.enter,name)
- if not data[name] then
- data[name]={wins=0,matchs=0,kills=0,max=0,score=0,mks=0,kd=0,killed=-1,team="",immortal=false,imatchs=0,immortal2=false}
- end
- if valendo == false and reset == false then
- ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>", name, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
- ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>", name, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,24,70,24,0x000001,0x000001,0.75,true)
- for i=32,123 do
- tfm.exec.bindKeyboard(name,i,true,true)
- system.bindMouse(name,true)
- end
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- tfm.exec.setPlayerScore(name,0,false)
- end
- function eventKeyboard(name,key,down,x,y)
- if anvil_launched == false then
- if actual_player == name then
- if key == 32 then
- if valendo == true then
- powerups.fly=false
- set=false
- set_name=""
- if powerups.selective == true then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(object,x,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(object,x,y-60,0,4+power*2,-8)
- end
- end
- if powerups.objeto == true and powerups.selective == false then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(objetos[math.random(#objetos)],x,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(objetos[math.random(#objetos)],x,y-60,0,4+power*2,-8)
- end
- if powerups.double == true and powerups.selective == false then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(objetos[math.random(#objetos)],x+40,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(objetos[math.random(#objetos)],x-40,y-60,0,4+power*2,-8)
- end
- end
- if powerups.triple == true and powerups.selective == false then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(objetos[math.random(#objetos)],x+80,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(objetos[math.random(#objetos)],x-80,y-60,0,4+power*2,-8)
- end
- end
- anvil_launched=true
- else
- if powerups.invisible == false and powerups.selective == false then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],x,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],x,y-60,0,4+power*2,-8)
- end
- if powerups.double == true then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],x+40,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],x-40,y-60,0,4+power*2,-8)
- end
- end
- if powerups.triple == true then
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],x+80,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(anvils[math.random(#anvils)],x-80,y-60,0,4+power*2,-8)
- end
- end
- else
- if data[name].team == "azul" then
- tfm.exec.addShamanObject(1010,x,y-60,0,(4+power*2)*-1,-8)
- elseif data[name].team == "vermelho" then
- tfm.exec.addShamanObject(1010,x,y-60,0,4+power*2,-8)
- end
- end
- anvil_launched=true
- end
- end
- end
- end
- if key >= 49 and key <= 57 then
- power=key-48
- ui.addPopup(0,0,""..text.intensity..": "..power.."",name,350,175,200,true)
- end
- if key == 48 then
- power=10
- ui.addPopup(0,0,""..text.intensity..": "..power.."",name,350,175,200,true)
- end
- if powerups.selective == false then
- if key == 112 then
- if tfm.get.room.playerList[name].score >= 5 and powerups.double == false and powerups.triple == false then
- powerups.double=true
- tfm.exec.setPlayerScore(name,-5,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.double.."")
- end
- end
- if key == 113 then
- if tfm.get.room.playerList[name].score >= 9 and powerups.double == false and powerups.triple == false then
- powerups.double=true
- powerups.triple=true
- tfm.exec.setPlayerScore(name,-9,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.triple.."")
- end
- end
- if key == 114 then
- if tfm.get.room.playerList[name].score >= 7 and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
- powerups.bomba=true
- tfm.exec.setPlayerScore(name,-7,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.bomba1.."")
- tfm.exec.chatMessage(text.bomba2,name)
- anvil_launched=true
- loop=12
- end
- end
- if key == 115 then
- if tfm.get.room.playerList[name].score >= 6 and powerups.objeto == false then
- powerups.objeto=true
- tfm.exec.setPlayerScore(name,-6,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.objeto1.."")
- tfm.exec.chatMessage(text.objeto2,name)
- end
- end
- if key == 116 then
- if tfm.get.room.playerList[name].score >= 22 and powerups.explosion == false and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
- powerups.explosion=true
- tfm.exec.setPlayerScore(name,-22,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.exp1.."")
- tfm.exec.chatMessage(text.exp2,name)
- anvil_launched=true
- loop=12
- end
- end
- if key == 117 then
- if tfm.get.room.playerList[name].score >= 18 and powerups.explosion == false and powerups.bomba == false and powerups.double == false and powerups.objeto == false then
- powerups.chuva=true
- tfm.exec.setPlayerScore(name,-18,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.chuva1.."")
- tfm.exec.chatMessage(text.chuva2,name)
- end
- end
- if key == 118 then
- if tfm.get.room.playerList[name].score >= 6 and powerups.fly == false then
- powerups.fly=true
- tfm.exec.setPlayerScore(name,-6,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.fly1.."")
- tfm.exec.chatMessage(text.fly2,name)
- end
- end
- if key == 119 then
- if tfm.get.room.playerList[name].score >= 20 and data[name].immortal2 == false then
- data[name].immortal=true
- data[name].immortal2=true
- tfm.exec.setNameColor(name, 0x00ff00)
- tfm.exec.setPlayerScore(name,-20,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.inv1.."")
- tfm.exec.chatMessage(text.inv2,name)
- end
- end
- if key == 120 then
- if tfm.get.room.playerList[name].score >= 25 and powerups.double == false and powerups.triple == false and powerups.objeto == false and powerups.invisible == false then
- powerups.invisible=true
- tfm.exec.setPlayerScore(name,-25,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.invi1.."")
- tfm.exec.chatMessage(text.invi2,name)
- end
- end
- if key == 121 then
- if tfm.get.room.playerList[name].score >= 5 and powerups.double == false and powerups.triple == false and powerups.objeto == false and powerups.invisible == false then
- powerups.selective=true
- ui.addTextArea(701,"<font size='12'>Select your object:<br>F1 = Anvil (0pt)<br>F2 = Small Box (1pt)<br>F3 = Green Apple (2pt)<br>F4 = Triangle (3pt)<br>F5 = Large Box (4pt)<br>F6 = Large Board (5pt)<br>F7 = Follow-up Box (6pt)<br>F8 = Giant Board (7pt)",actual_player,320,72,160,160,0x424242,0x424242,0.88,true)
- tfm.exec.setGameTime(15)
- time_limit=15
- tfm.exec.setPlayerScore(name,-5,true)
- tfm.exec.chatMessage("<VP>"..actual_player.." "..text.selec1.."")
- tfm.exec.chatMessage(text.selec2,name)
- end
- end
- else
- if key >= 112 and key <= 119 then
- if key == 112 then
- object=10
- elseif key == 113 then
- object=1
- tfm.exec.setPlayerScore(name,-1,true)
- elseif key == 114 then
- object=39
- tfm.exec.setPlayerScore(name,-2,true)
- elseif key == 115 then
- object=68
- tfm.exec.setPlayerScore(name,-3,true)
- elseif key == 116 then
- object=2
- tfm.exec.setPlayerScore(name,-4,true)
- elseif key == 117 then
- object=4
- tfm.exec.setPlayerScore(name,-5,true)
- elseif key == 118 then
- object=61
- tfm.exec.setPlayerScore(name,-6,true)
- elseif key == 119 then
- object=67
- tfm.exec.setPlayerScore(name,-7,true)
- end
- ui.removeTextArea(701,nil)
- end
- end
- end
- end
- function eventMouse(name,x,y)
- if powerups.explosion == true and actual_player == name then
- tfm.exec.explosion(x,y,30,120,true)
- tfm.exec.displayParticle(12,x,y,0,0,0,0,nil)
- powerups.explosion=false
- end
- if powerups.fly == true and actual_player == name and anvil_launched == false then
- if data[name].team == "vermelho" then
- if x < 790 and x > 200 then
- tfm.exec.movePlayer(name,x,190,false,0,0,false)
- end
- end
- if data[name].team == "azul" then
- if x > 810 and x < 1400 then
- tfm.exec.movePlayer(name,x,190,false,0,0,false)
- end
- end
- end
- end
- function eventNewGame()
- ui.setMapName(text.bar)
- sudden_death=false
- time_limit=15
- reset=false
- count_azul=0
- count_vermelho=0
- tempo=0
- power=5
- count=0
- kills=0
- play_azul={}
- play_vermelho={}
- valendo=false
- loop=8
- resetPowers()
- for name,player in pairs(tfm.get.room.playerList) do
- data[name].kd=math.floor((data[name].kills/data[name].matchs)*100)
- data[name].killed=-1
- data[name].team=""
- data[name].immortal=false
- data[name].immortal2=false
- data[name].imatchs=0
- tfm.exec.setNameColor(name,0xd7d7e6)
- for i=32,123 do
- tfm.exec.bindKeyboard(name,i,true,true)
- end
- end
- tfm.exec.setGameTime(32)
- ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>",nil, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
- ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>",nil, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
- tfm.exec.chatMessage("The profile and ranking has been updated.")
- end
- function eventTextAreaCallback(id,name,callback)
- if callback == "show_menu" then
- ui.addTextArea(299,"<p align='center'><a href='event:hide_menu'><font size='18'>Menu",name,365,24,70,24,0x000001,0x000001,0.75,true)
- ui.addTextArea(298,text.menu_bar,name,275,55,250,20,0x000001,0x000001,0.80,true)
- end
- if callback == "hide_menu" then
- ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,24,70,24,0x000001,0x000001,0.75,true)
- ui.removeTextArea(298,name)
- end
- if callback == "ranking" then
- eventChatCommand(name,"rank")
- end
- if callback == "powerups" then
- loadPowerups(name)
- end
- if callback == "power1" then
- tfm.exec.chatMessage(text.double2,name)
- end
- if callback == "help" then
- tfm.exec.chatMessage(text.help,name)
- end
- if callback == "power2" then
- tfm.exec.chatMessage(text.triple2,name)
- end
- if callback == "power3" then
- tfm.exec.chatMessage(text.bomba2,name)
- end
- if callback == "power4" then
- tfm.exec.chatMessage(text.objeto2,name)
- end
- if callback == "power5" then
- tfm.exec.chatMessage(text.exp2,name)
- end
- if callback == "power6" then
- tfm.exec.chatMessage(text.chuva2,name)
- end
- if callback == "power7" then
- tfm.exec.chatMessage(text.fly2,name)
- end
- if callback == "power8" then
- tfm.exec.chatMessage(text.inv2,name)
- end
- if callback == "power9" then
- tfm.exec.chatMessage(text.invi2,name)
- end
- if callback == "power10" then
- tfm.exec.chatMessage(text.selec2,name)
- end
- if callback == "profile" then
- tfm.exec.chatMessage(text.profile,name)
- end
- if callback == "fechar" then
- for id=8000,8010 do
- ui.removeTextArea(id,name)
- end
- end
- if callback == "close" then
- for id=8000,8010 do
- ui.removeTextArea(id,name)
- ui.removeTextArea(6969+id,name)
- ui.removeTextArea(7979+id,name)
- end
- end
- if callback == "closep" then
- for id=9000,9010 do
- ui.removeTextArea(id,name)
- end
- end
- if callback == "enter_vermelho" then
- if data[name].killed == -1 and data[name].team == "" then
- data[name].team="vermelho"
- data[name].killed=0
- tfm.exec.respawnPlayer(name)
- tfm.exec.movePlayer(name,math.random(200,750),180,false,0,0,false)
- count_vermelho=count_vermelho+1
- ui.removeTextArea(41,name)
- ui.removeTextArea(42,name)
- ui.addTextArea(51,"<p align='center'><a href='event:sair_vermelho'>"..text.exit.."",name,300,180,200,20,0x505050,0x323232,1.0,true)
- end
- end
- if callback == "enter_azul" then
- if data[name].killed == -1 and data[name].team == "" then
- data[name].team="azul"
- data[name].killed=0
- tfm.exec.respawnPlayer(name)
- tfm.exec.movePlayer(name,math.random(850,1400),180,false,0,0,false)
- count_azul=count_azul+1
- ui.removeTextArea(41,name)
- ui.removeTextArea(42,name)
- ui.addTextArea(52,"<p align='center'><a href='event:sair_azul'>"..text.exit.."",name,300,180,200,20,0x505050,0x323232,1.0,true)
- end
- end
- if callback == "sair_azul" then
- data[name].team=""
- data[name].killed=-1
- tfm.exec.killPlayer(name)
- count_azul=count_azul-1
- ui.removeTextArea(52,name)
- ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>", name, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
- ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>", name, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
- end
- if callback == "sair_vermelho" then
- data[name].team=""
- data[name].killed=-1
- tfm.exec.killPlayer(name)
- count_vermelho=count_vermelho-1
- ui.removeTextArea(51,name)
- ui.addTextArea(41, "<p align='center'><a href='event:enter_vermelho'>"..text.enter_vermelho.."</a></p>", name, 300, 165, 200, 20, 0x800000, 0x600000,1.0,true)
- ui.addTextArea(42, "<p align='center'><a href='event:enter_azul'>"..text.enter_azul.."</a></p>", name, 300, 195, 200, 20, 0x80, 0x60,1.0,true)
- end
- end
- function winRed()
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].team == "vermelho" then
- data[name].wins=data[name].wins+1
- data[name].score=data[name].score+15
- tfm.exec.respawnPlayer(name)
- tfm.exec.movePlayer(name,math.random(125,775),240,false,0,0,false)
- tfm.exec.playEmote(name,0)
- end
- end
- end
- function winAzul()
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].team == "azul" then
- data[name].wins=data[name].wins+1
- data[name].score=data[name].score+15
- tfm.exec.respawnPlayer(name)
- tfm.exec.movePlayer(name,math.random(825,1475),240,false,0,0,false)
- tfm.exec.playEmote(name,0)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement