Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Guerra de shamans
- -- Créditos:Brenower
- -- Tables
- data={};
- obj = {1,2,3,4,5,6,7,8,9,10,21,22,23,25,26,27,28,32,44};
- -- Data
- for player in pairs(tfm.get.room.playerList) do
- newData={
- ["team"]="...";
- ["score"]=0;
- ["title"]="...";
- ["wins"]=0;
- ["admin"]=false;
- ["banned"]=false;
- ["powerup"]=0;
- ["time"]=os.time();
- };
- data[player] = newData;
- end
- alive=0;
- minigame={
- ["version"]="1.5";
- ["creators"]="Brenower and Laagaadoo";
- ["alivet1"]=0;
- ["alivet2"]=0;
- ["currentMap"]=0;
- ["win"]=false;
- };
- lobby={"4621649"};
- war={"4621649","4622871",};
- lang={
- BR={
- ["help1"]="<TI><J>• Objetivo:<font size='11'><N2><br />Matar todos os shamans da equipe oponente.</font><br /><TI><J>• Como jogar:<font size='11'><N2><br />Invoque canhões para matar a equipe oponente e assim ganhar a partida.</font><br /><TI><J>• Mais informações:<N2><font size='11'><br />A cada partida ganha você ganha 1 ponto e é contado em seu perfil que mais uma partida foi ganha.</font><br /><TI><J>• Alguns comandos:<font size='11'><V>!pwp help <G>-<N2> Mostra as informaçõe sobre powerups.<br /><V>!shop help<G> -<N2> mostra informações sobre a loja.";
- ["help2"]="<TI><J>• Comandos:<font size='11'><N2><br /><V>!perfil NOMEDOJOGADOR(ou me) <G>- <N2>Mostra as estasticas do jogador citado, caso seja usado o <V>!perfil me<N2> mostra as suas estatisticas.<br /><V>!help <G>-<N2> Mostra como jogar o mini game e etc.<br /><V>!msg MENSAGEM <G>-<N2> Envia uma mensagem para a sua equipe.<br /><V>!pwp help <G>-<N2> Mostra informaçõe sobre os powerups.</font><br /><TI><J>• Créditos:<font size='11'><N2><br />Brenower, Laagaadoo.<br /><J>Agradecimentos:<N2>Fluffyshine(ideias).</font>";
- ["powerup"]="<TI><J>• O que é?<font size='11'><N2><br />Powerups é upgrades que melhoram sua perfomance pelo mini game.</font><br /><TI><J>• Como ganhar um?<font size='11'><N2><br />Basta falar no chat <V>!pwp choose<N2> e escolher seu powerup.</font><br /><TI><J>• Perguntas frequentes<font size='11'><br /><VP>1.Quantos powerups posso escolher?<N2>Apenas um.<br /><VP>2.O que o powerup 1 faz?<N2>Ele deixa você voar pelo mapa por 5 segundos.<br /><VP>3.O que o powerup 2 faz?<N2>Ele deixa você mais rápido por 5 segundos.<br /><VP>3.O que o powerup 3 faz?<N2>Você pode se teleportar pelo mapa a cada 5 segundos.</font>";
- ["pwpch"]="<TI><J>• Escolha um powerup:<font size='11'><V><br /><a href='event:p1'>Powerup 1 - Deixa você voar pelo mapa por 5 segundos.</a><br /><br /><a href='event:p2'>Powerup 2 - Deixa você andar pelo mapa mais rápido por 5 segundos.</a><br /><br /><a href='event:p3'>Powerup 3 - Você pode se teleportar pelo mapa a cada 5 segundos.</a></font><br /><TI><J>• Observações:<N2><font size='11'>*Para escolhe um powerup é preciso estar no lobby, para usar o powerup 3 clique em algum lugar com o mouse, para usar o powerup 1 e 2 aperte espaço.</font>";
- ["shoph"]="<font size='12'><J>• O que é?<font size='11'><N2><br />É uma loja de titles onde você pode comprar-los pelos mais variados preços.<br /><font size='12'><J>• Como posso comprar-los?<N2><font size='11'><br />Fale <V>!shop buy<N2> e clique no que você deseja comprar.<br /><font size='12'><J>• Como posso ver meu title ou de outro jogador?<br /><N2><font size='11'>Use o comando <V>!perfil me<N2> para ver seu title e o comando <V>!perfil NOMEDOJOGADOR<N2> para ver o title de outro jogador.<br /><J><font size='12'>• Como posso ganhar pontos?<font size='11'><N2><br />Ganhando partidas, a cada uma partida ganha você ganha 3 pontos.";
- ["shop"]="<TI><J>• Loja de títulos:<font size='11'><N2><br /><a href='event:s1'>Guerreiro Novato <G>-<V> 1 pontos.</a><br /><a href='event:s2'><N2>Guerreiro aprendiz <G>-<V> 5 pontos.</a><br /><N2><a href='event:s3'><N2>CN Master <G>-<V> 25 Pontos</a></font>";
- ["buys"]="<p align='center'><font color='#2ECF73'>Compra efetuada!</font></p>";
- ["buye"]="<p algn='center'><font color='#CB546B'>Não foi possível realizar a compra. :(</font></p>";
- ["chat"]="<VP>Chat para <R>adms<VP> e <J>equipes<VP>.";
- ["newtitle"]="<VP>Você ganhou um novo <CH>título<VP>!";
- ["warstarted"]="<VP> A <G>guerra<VP> começou, lutem!";
- ["teams"]={"Azul","Rosa"};
- ["team1"]="Azul";
- ["team2"]="Rosa";
- ["stats"]="";
- ["statsme"]="";
- ["lobby"]="<VP>Bem vindo ao <CH>Guerra de Shamans<VP>!<br /><R>[~Lua]<VP> Seu time atual é o <J>";
- ["team1won"]="<VP> A equipe <J>azul<VP> ganhou!";
- ["team2won"]="<VP> A equipe <J>rosa<VP> ganhou!";
- ["object"]="<VP>A invocaçâo deste objeto não é permitida!";
- ["minigame"]="Guerra de shamans";
- ["title1"]="Guerreiro novato";
- ["title2"]="Guerreiro aprendiz";
- ["title3"]="CN Master";
- ["stats1"]="<font color='#6C77C1'>• Equipe atual : </font>";
- ["stats2"]="<font color='#6C77C1'>• Partidas vencidas : </font>";
- ["stats3"]="<font color='#6C77C1'>• Pontos : </font>";
- ["stats4"]="<font color='#6C77C1'>• Título atual : </font>";
- ["escbug"]="<VP>Sem uso de <J>bugs<VP>!";
- };
- EN={
- ["help1"]="<TI><J>• Objective:<font size='11'><N2><br />Kill all shamans of the opponent team.</font><br /><TI><J>• How to play:<font size='11'><N2><br />Invoke cannons to kill the opponent team and win the match.</font><br /><TI><J>• More information:<N2><font size='11'><br />For each match won, you earn 1 point.</font><br /><TI><J>• Some commands:<font size='11'><V>!pwp help <G>-<N2> Shows the information about power ups.<br /><V>!loja help<G> -<N2> Shows the information about the shop.";
- ["help2"]="<TI><J>• Commands:<font size='11'><N2><br /><V>!perfil NAMEOFPLAYER(or me) <G>- <N2>Shows the statistics about the player cited. If you use <V>!perfil me<N2>, it shows your profile.<br /><V>!help <G>-<N2> Shows the information about the minigame.<br /><V>!msg MESSAGE <G>-<N2> Sends a message to your team.<br /><V>!pwp help <G>-<N2> Shows the information about power ups.</font><br /><TI><J>• Credits:<font size='11'><N2><br />Brenower, Laagaadoo.<br /><J>Thanks: <N2>Fluffyshine(ideas).</font>";
- ["powerup"]="<TI><J>• What is?<font size='11'><N2><br />Power ups is upgrades that improve their performance at minigame.</font><br /><TI><J>• How to earn one?<font size='11'><N2><br />Type <V>!pwp choose<N2> and choose your power up.</font><br /><TI><J>• Frequent Questions<font size='11'><br /><VP>1.How many powerups can I have?<N2>Only one.<br /><VP>2.What makes the first power up?<N2>It allow that you can fly by 5 seconds.<br /><VP>3.What makes the second power up?<N2>It increases your velocity by 5 seconds.<br /><VP>3.What makes the third power up?<N2>It allow you teleport by map each 5 seconds.</font>";
- ["pwpch"]="<TI><J>• Choose a power up:<font size='11'><V><br /><a href='event:p1'>Power up 1 - Allows you fly by 5 seconds.</a><br /><br /><a href='event:p2'>Power up 2 - Increases your velocity by 5 seconds.</a><br /><br /><a href='event:p3'>Power up 3 - Allows teleport by map each 5 seconds.</a></font><br /><TI><J>• Note:<N2><font size='11'>*To choose a power up you need to be in the lobby, to use the third power up, click in the map, to use the first and the second power up, press space.</font>";
- ["shoph"]="<font size='12'><J>• What is?<font size='11'><N2><br />It's a shop of titles that you can buy titles.<br /><font size='12'><J>• How to buy?<N2><font size='11'><br />Type <V>!shop buy<N2> and click in the that you want buy.<br /><font size='12'><J>• How to see my title or of other player?<br /><N2><font size='11'>Type <V>!perfil me<N2> to see your title. Type <V>!perfil NAMEOFPLAYER<N2> to see the title of other player.<br /><J><font size='12'>• How to earn points?<font size='11'><N2><br />Winning matches, for each match won you earn three points.";
- ["shop"]="<TI><J>• Shop of titles:<font size='11'><N2><br /><a href='event:s1'>Novice Warrior <G>-<V> One point.</a><br /><a href='event:s2'><N2>Apprentice Warrior <G>-<V> Five points.</a><br /><N2><a href='event:s3'><N2>Cannon Master <G>-<V> Twenty-five points</a></font>";
- ["buys"]="<p align='center'><font color='#2ECF73'>Purchased successfully!</font></p>";
- ["buye"]="<p algn='center'><font color='#CB546B'>Unable to make the purchase. :(</font></p>";
- ["chat"]="<VP>Chat for <R>admins<VP> and <J>teams<VP>.";
- ["newtitle"]="<VP>You earned a new <CH>title<VP>!";
- ["warstarted"]="<VP> The <G>war<VP> has started, fight!";
- ["teams"]={"Blue","Pink"};
- ["team1"]="Blue";
- ["team2"]="Pink";
- ["stats"]="";
- ["statsme"]="";
- ["lobby"]="<VP>Welcome to the <CH>War of Shamans<VP>!<br /><R>[~Lua]<VP> Your current team is <J>";
- ["team1won"]="<VP> The <J>blue<VP> team has won!";
- ["team2won"]="<VP> The <J>pink<VP> team has won!";
- ["object"]="<VP>This object is not allowed!";
- ["minigame"]="Guerra de shamans";
- ["title1"]="Novice Warrior";
- ["title2"]="Apprentice Warrior";
- ["title3"]="Cannon Master";
- ["stats1"]="<font color='#6C77C1'>• Current team : </font>";
- ["stats2"]="<font color='#6C77C1'>• Matches won : </font>";
- ["stats3"]="<font color='#6C77C1'>• Points : </font>";
- ["stats4"]="<font color='#6C77C1'>• Current title : </font>";
- ["escbug"]="<VP>No use of <J>bugs<VP>!";
- };
- INT={
- ["help1"]="<TI><J>• Objective:<font size='11'><N2><br />Kill all shamans of the opponent team.</font><br /><TI><J>• How to play:<font size='11'><N2><br />Invoke cannons to kill the opponent team and win the match.</font><br /><TI><J>• More information:<N2><font size='11'><br />For each match won, you earn 1 point.</font><br /><TI><J>• Some commands:<font size='11'><V>!pwp help <G>-<N2> Shows the information about power ups.<br /><V>!loja help<G> -<N2> Shows the information about the shop.";
- ["help2"]="<TI><J>• Commands:<font size='11'><N2><br /><V>!perfil NAMEOFPLAYER(or me) <G>- <N2>Shows the statistics about the player cited. If you use <V>!perfil me<N2>, it shows your profile.<br /><V>!help <G>-<N2> Shows the information about the minigame.<br /><V>!msg MESSAGE <G>-<N2> Sends a message to your team.<br /><V>!pwp help <G>-<N2> Shows the information about power ups.</font><br /><TI><J>• Credits:<font size='11'><N2><br />Brenower, Laagaadoo.<br /><J>Thanks: <N2>Fluffyshine(ideas).</font>";
- ["powerup"]="<TI><J>• What is?<font size='11'><N2><br />Power ups is upgrades that improve their performance at minigame.</font><br /><TI><J>• How to earn one?<font size='11'><N2><br />Type <V>!pwp choose<N2> and choose your power up.</font><br /><TI><J>• Frequent Questions<font size='11'><br /><VP>1.How many powerups can I have?<N2>Only one.<br /><VP>2.What makes the first power up?<N2>It allow that you can fly by 5 seconds.<br /><VP>3.What makes the second power up?<N2>It increases your velocity by 5 seconds.<br /><VP>3.What makes the third power up?<N2>It allow you teleport by map each 5 seconds.</font>";
- ["pwpch"]="<TI><J>• Choose a power up:<font size='11'><V><br /><a href='event:p1'>Power up 1 - Allows you fly by 5 seconds.</a><br /><br /><a href='event:p2'>Power up 2 - Increases your velocity by 5 seconds.</a><br /><br /><a href='event:p3'>Power up 3 - Allows teleport by map each 5 seconds.</a></font><br /><TI><J>• Note:<N2><font size='11'>*To choose a power up you need to be in the lobby, to use the third power up, click in the map, to use the first and the second power up, press space.</font>";
- ["shoph"]="<font size='12'><J>• What is?<font size='11'><N2><br />It's a shop of titles that you can buy titles.<br /><font size='12'><J>• How to buy?<N2><font size='11'><br />Type <V>!shop buy<N2> and click in the that you want buy.<br /><font size='12'><J>• How to see my title or of other player?<br /><N2><font size='11'>Type <V>!perfil me<N2> to see your title. Type <V>!perfil NAMEOFPLAYER<N2> to see the title of other player.<br /><J><font size='12'>• How to earn points?<font size='11'><N2><br />Winning matches, for each match won you earn three points.";
- ["shop"]="<TI><J>• Shop of titles:<font size='11'><N2><br /><a href='event:s1'>Novice Warrior <G>-<V> One point.</a><br /><a href='event:s2'><N2>Apprentice Warrior <G>-<V> Five points.</a><br /><N2><a href='event:s3'><N2>Cannon Master <G>-<V> Twenty-five points</a></font>";
- ["buys"]="<p align='center'><font color='#2ECF73'>Purchased successfully!</font></p>";
- ["buye"]="<p algn='center'><font color='#CB546B'>Unable to make the purchase. :(</font></p>";
- ["chat"]="<VP>Chat for <R>admins<VP> and <J>teams<VP>.";
- ["newtitle"]="<VP>You earned a new <CH>title<VP>!";
- ["warstarted"]="<VP> The <G>war<VP> has started, fight!";
- ["teams"]={"Blue","Pink"};
- ["team1"]="Blue";
- ["team2"]="Pink";
- ["stats"]="";
- ["statsme"]="";
- ["lobby"]="<VP>Welcome to the <CH>War of Shamans<VP>!<br /><R>[~Lua]<VP> Your current team is <J>";
- ["team1won"]="<VP> The <J>blue<VP> team has won!";
- ["team2won"]="<VP> The <J>pink<VP> team has won!";
- ["object"]="<VP>This object is not allowed!";
- ["minigame"]="Guerra de shamans";
- ["title1"]="Novice Warrior";
- ["title2"]="Apprentice Warrior";
- ["title3"]="Cannon Master";
- ["stats1"]="<font color='#6C77C1'>• Current team : </font>";
- ["stats2"]="<font color='#6C77C1'>• Matches won : </font>";
- ["stats3"]="<font color='#6C77C1'>• Points : </font>";
- ["stats4"]="<font color='#6C77C1'>• Current title : </font>";
- ["escbug"]="<VP>No use of <J>bugs<VP>!";
- };
- };
- cmm = tfm.get.room.community
- win=false;
- -- Script inicial
- ui.addTextArea(8,"<a href='event:help'><font size='14'><p align='center'><b>?</b></font></p></a>",NIL,775,70,20,17,1,1,0.9,true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAllShamanSkills(true)
- tfm.exec.newGame(lobby[math.random(#lobby)])
- system.disableChatCommandDisplay("perfil",true)
- system.disableChatCommandDisplay("ban",true)
- system.disableChatCommandDisplay("msg",true)
- system.disableChatCommandDisplay("txt",true)
- system.disableChatCommandDisplay("unban",true)
- system.disableChatCommandDisplay("stats",true)
- -- New game
- function eventNewGame()
- alive=0;
- for players in pairs(tfm.get.room.playerList) do
- alive=alive+1;
- tfm.exec.bindKeyboard(players,27,true,true)
- tfm.exec.bindKeyboard(players,32,true,true)
- system.bindMouse(players,true)
- if data[players].banned == true then
- tfm.exec.killPlayer(player)
- end
- end
- minigame.currentMap=minigame.currentMap+1;
- ui.addTextArea(2,"<p align='center'><R>[~Lua] "..lang[cmm].chat.."",NIL,5,380,750,35,0,0,1,true)
- if minigame.currentMap == 1 then
- eventLobby()
- end
- if minigame.currentMap == 2 then
- eventWar()
- end
- if minigame.currentMap == 3 then
- eventLobby()
- end
- end
- -- lobby
- function eventLobby()
- minigame.currentMap=1;
- tfm.exec.setGameTime(30)
- eventTeam()
- end
- -- Selecionar equipe
- function eventTeam()
- local Players = {}
- for playerName in pairs(tfm.get.room.playerList) do
- table.insert(Players, playerName)
- tfm.exec.setNameColor(playerName,0x9292AA)
- end
- for i = 1, #Players, 1 do
- local random= math.random(#Players)
- local Nome = Players[random]
- if(i%2 == 0) then
- data[Nome].team = ""..lang[cmm].team2.."";
- else
- data[Nome].team = ""..lang[cmm].team1.."";
- end
- table.remove(Players, random)
- end
- for player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(1,"<p align='center'>"..lang[cmm].lobby.."<J>"..data[player].team.."<VP>!</p>",player,5,25,750,35,0,0,1,true)
- end
- end
- -- Guerra
- function eventWar()
- win=false;
- minigame.alive=0;
- minigame.alivet1=0;
- minigame.alivet2=0;
- ui.updateTextArea(1,"<p align='center'><R>[~Lua] "..lang[cmm].warstarted.."</p>",NIL)
- eventTeams()
- end
- -- Ver equipe
- function eventTeams()
- for player in pairs(tfm.get.room.playerList) do
- if data[player].team == lang[cmm].team1 then
- tfm.exec.setShaman(player)
- tfm.exec.setNameColor(player,0x98E2EB)
- minigame.alivet1=minigame.alivet1+1;
- end
- if data[player].team == lang[cmm].team2 then
- tfm.exec.setShaman(player)
- tfm.exec.setNameColor(player,0xFEB1FC)
- minigame.alivet2=minigame.alivet2+1;
- end
- if data[player].team == "..." then
- tfm.exec.killPlayer(player)
- end
- end
- end
- -- Comandos
- function eventChatCommand(player,cm)
- if data[player].admin == true or player == [[Brenower]] then
- if (cm:sub(0,3) == [[txt]]) then
- ui.updateTextArea(2,"<p align='center'><R>[~Adm]<V> ["..player.."]<N2> "..cm:sub(5).."",NIL)
- end
- if (cm:sub(0,3) == [[adm]]) then
- for str,num in pairs(tfm.get.room.playerList) do
- if (str == cm:sub(5)) then
- data[str].admin = true;
- end
- end
- end
- if (cm:sub(0,3) == [[ban]]) then
- for str,num in pairs(tfm.get.room.playerList) do
- if (str == cm:sub(5)) then
- data[str].banned = true;
- tfm.exec.killPlayer(str)
- end
- end
- end
- if (cm:sub(0,5) == [[unban]]) then
- for str,num in pairs(tfm.get.room.playerList) do
- if (str == cm:sub(7)) then
- data[str].banned = false;
- end
- end
- end
- if (cm:sub(0,5) == [[title]]) then
- data[player].title = ""..cm:sub(7).."";
- end
- end
- if (cm:sub(0,3) == [[msg]]) then
- for players in pairs(tfm.get.room.playerList) do
- if data[player].team == lang[cmm].team1 then
- for players in pairs(tfm.get.room.playerList) do
- if data[players].team == lang[cmm].team1 then
- ui.updateTextArea(2,"<p align='center'><font color='#98E2EB'>[~"..lang[cmm].team1.."]</font><V> ["..player.."]<N2> "..cm:sub(5).."",players)
- end
- end
- end
- if data[player].team == lang[cmm].team2 then
- if data[players].team == lang[cmm].team2 then
- for players in pairs(tfm.get.room.playerList) do
- ui.updateTextArea(2,"<p align='center'><font color='#FEB1FC'>[~"..lang[cmm].team2.."]</font><V> ["..player.."]<N2> "..cm:sub(5).."",players)
- end
- end
- end
- end
- end
- if cm == "help" or cm == "ajuda" then
- eventTextAreaCallback(8,player,"help")
- end
- if (cm:sub(0,5) == [[stats]] or cm:sub(0,6) == [[perfil]]) then
- for str,num in pairs(tfm.get.room.playerList) do
- if (str == cm:sub(7) or str == cm:sub(8)) then
- ui.addPopup(1,0,"<p align='center'><font size='18' face='Soopafresh'>"..str.."</font></p><br />"..lang[cmm].stats1.."<font color='#BABD2F'>"..data[str].team.."<br />"..lang[cmm].stats2..""..data[str].wins.."<br />"..lang[cmm].stats3..""..data[str].score.."<br />"..lang[cmm].stats4..""..data[str].title.."</font>",player,300,175,230)
- end
- if (cm:sub(7) == [[me]] or cm:sub(8) == [[me]]) then
- ui.addPopup(1,0,"<p align='center'><font size='18' face='Soopafresh'>"..player.."</font></p><br />"..lang[cmm].stats1.."<font color='#BABD2F'>"..data[player].team.."<br />"..lang[cmm].stats2..""..data[player].wins.."<br />"..lang[cmm].stats3..""..data[player].score.."<br />"..lang[cmm].stats4..""..data[player].title.."</font>",player,300,175,230)
- end
- end
- end
- if (cm:sub(0,3) == [[pwp]]) then
- if (cm:sub(5) == [[help]]) then
- ui.addTextArea(9,"<p align='center'>"..lang[cmm].powerup.."</p>",player,275,100,250,215,1,1,0.8,true)
- ui.addTextArea(10,"<p align='center'><a href='event:closep'><b>X</b></a></p>",player,275,73,15,15,1,1,0.8,true)
- end
- if (cm:sub(5) == [[choose]]) then
- ui.addTextArea(11,"<p align='center'>"..lang[cmm].pwpch.."</p>",player,275,100,250,200,1,1,0.8,true)
- ui.addTextArea(12,"<p align='center'><a href='event:closepc'><b>X</b></a></p>",player,275,73,15,15,1,1,0.8,true)
- end
- end
- if (cm:sub(0,4) == [[shop]]) then
- if (cm:sub(6) == [[help]]) then
- ui.addTextArea(13,"<p align='center'>"..lang[cmm].shoph.."</p>",player,275,100,260,200,1,1,0.8,true)
- ui.addTextArea(14,"<p align='center'><a href='event:closes'><b>X</b></a></p>",player,275,73,15,15,1,1,0.8,true)
- end
- if (cm:sub(6) == [[buy]]) then
- ui.addTextArea(15,"<p align='center'>"..lang[cmm].shop.."</p>",player,275,100,250,200,1,1,0.8,true)
- ui.addTextArea(16,"<p align='center'><a href='event:closes2'><b>X</b></a></p>",player,275,73,15,15,1,1,0.8,true)
- end
- end
- end
- -- Loop
- function eventLoop(ct,rt)
- if minigame.currentMap == 1 then
- if rt <= 0 then
- tfm.exec.newGame(war[math.random(#war)])
- end
- if alive == 0 then
- tfm.exec.newGame(war[math.random(#war)])
- end
- end
- if minigame.currentMap == 2 then
- if rt <= 0 then
- tfm.exec.newGame(lobby[math.random(#lobby)])
- end
- if alive == 0 then
- tfm.exec.newGame(lobby[math.random(#lobby)])
- end
- end
- end
- -- Jogador morre
- function eventPlayerDied(player)
- alive=alive-1;
- if minigame.currentMap == 2 then
- tfm.exec.setUIShamanName("<BL> | <CH>"..lang[cmm].team1.." : <N2>"..minigame.alivet1.." <BL>| <font color='#FEB1FC'>"..lang[cmm].team2.." :<N2> "..minigame.alivet2.."")
- if data[player].team == lang[cmm].team1 then
- minigame.alivet1=minigame.alivet1-1;
- end
- if data[player].team == lang[cmm].team2 then
- minigame.alivet2=minigame.alivet2-1;
- end
- tfm.exec.setUIShamanName("<G>* | <CH>"..lang[cmm].team1.." : <N2>"..minigame.alivet1.." <G>| <font color='#FEB1FC'>"..lang[cmm].team2.." :<N2> "..minigame.alivet2.."")
- if win == false then
- if minigame.alivet1 == 0 then
- ui.updateTextArea(1,"<R>[~Lua] "..lang[cmm].team2won.."",NIL)
- tfm.exec.setGameTime(15)
- win=true;
- for players in pairs(tfm.get.room.playerList) do
- if data[players].team == lang[cmm].team2 then
- data[players].wins = data[player].wins+1;
- data[players].score = data[players].score+3;
- end
- end
- end
- if minigame.alivet2 == 0 then
- ui.updateTextArea(1,"<R>[~Lua] "..lang[cmm].team1won.."",NIL)
- tfm.exec.setGameTime(15)
- win=true;
- for players in pairs(tfm.get.room.playerList) do
- if data[players].team == lang[cmm].team1 then
- data[players].wins = data[player].wins+1;
- data[players].score = data[players].score+3;
- end
- end
- end
- end
- end
- end
- -- Jogador termina de invocar algo
- function eventSummoningEnd(player,Obje,xPosition,yPosition,angle,xSpeed,ySpeed,other)
- for index,objs in pairs(obj) do
- if objs == Obje then
- tfm.exec.removeObject(other.id)
- end
- end
- end
- -- Esc bug
- function eventKeyboard(player,key,down,x,y)
- if key == 27 then
- if down == true then
- tfm.exec.killPlayer(player)
- ui.updateTextArea(1,"<R>[~Lua] "..lang[cmm].escbug.."",player)
- end
- end
- if tfm.get.room.playerList[player].y >= 65 then
- if key == 32 then
- if data[player].powerup == 1 and data[player].time < os.time()-5000 and minigame.currentMap == 2 then
- tfm.exec.movePlayer(player,xx,yy,false,0,-50,false)
- if data[player].time < os.time()-10000 then
- data[player].time = os.time();
- end
- end
- if data[player].powerup == 2 and data[player].time < os.time()-5000 and minigame.currentMap == 2 then
- if tfm.get.room.playerList[player].isFacingRight then
- tfm.exec.movePlayer(player,xx,yy,false,50,0,false)
- else
- tfm.exec.movePlayer(player,xx,yy,false,-50,0,false)
- end
- if data[player].time < os.time()-10000 then
- data[player].time = os.time();
- end
- end
- end
- end
- end
- -- Novo jogador entra na sala
- function eventNewPlayer(player)
- if not data[player] then
- newData={
- ["team"]="...";
- ["score"]=0;
- ["title"]="...";
- ["wins"]=0;
- ["admin"]=false;
- ["banned"]=false;
- ["powerup"]=0;
- ["time"]=os.time();
- };
- data[player] = newData;
- end
- ui.addTextArea(8,"<a href='event:help'><font size='14'><p align='center'><b>?</b></font></p></a>",NIL,775,70,20,17,1,1,0.9,true)
- end
- -- Links de uma textarea
- function eventTextAreaCallback(id,player,link)
- if link == "help" then
- ui.addTextArea(4,"<p align='center'>"..lang[cmm].help1.."</p>",player,275,100,250,200,1,1,0.8,true)
- ui.addTextArea(5,"<p align='center'><a href='event:closeh'><b>X</b></a></p>",player,275,73,15,15,1,1,0.8,true)
- ui.addTextArea(6,"<p align='center'><b><</b></p>",player,305,73,15,15,1,1,0.8,true)
- ui.addTextArea(7,"<p align='center'><b><a href='event:pag2'>></a></b></p>",player,335,73,15,15,1,1,0.8,true)
- end
- if minigame.currentMap == 1 then
- if link == "p1" then
- data[player].powerup = 1;
- ui.removeTextArea(11,player)
- ui.removeTextArea(12,player)
- end
- if link == "p2" then
- data[player].powerup = 2;
- ui.removeTextArea(11,player)
- ui.removeTextArea(12,player)
- end
- if link == "p3" then
- data[player].powerup = 3;
- ui.removeTextArea(11,player)
- ui.removeTextArea(12,player)
- end
- end
- if link == "closeh" then
- ui.removeTextArea(4,player)
- ui.removeTextArea(5,player)
- ui.removeTextArea(6,player)
- ui.removeTextArea(7,player)
- end
- if link == "pag2" then
- ui.updateTextArea(4,"<p align='center'>"..lang[cmm].help2.."</p>",player)
- ui.updateTextArea(6,"<p align='center'><a href='event:help'><</a></p>",player)
- end
- if link == "closep" then
- ui.removeTextArea(9,player)
- ui.removeTextArea(10,player)
- end
- if link == "closepc" then
- ui.removeTextArea(11,player)
- ui.removeTextArea(12,player)
- end
- if link == "s1" then
- eventBuyTitle(player,1)
- end
- if link == "s2" then
- eventBuyTitle(player,2)
- end
- if link == "s3" then
- eventBuyTitle(player,3)
- end
- if link == "closes" then
- ui.removeTextArea(13,player)
- ui.removeTextArea(14,player)
- end
- if link == "closes2" then
- ui.removeTextArea(15,player)
- ui.removeTextArea(16,player)
- end
- end
- -- Eventos do mouse
- function eventMouse(player,x,y)
- if y >= 65 and y <= 368 then
- if data[player].powerup == 3 and minigame.currentMap == 2 and data[player].time < os.time()-5000 then
- tfm.exec.movePlayer(player,x,y,false,0,0,false)
- data[player].time = os.time();
- end
- end
- end
- -- Compras da loja
- function eventBuyTitle(player,id)
- ui.removeTextArea(15,player)
- ui.removeTextArea(16,player)
- if id == 1 and data[player].score >= 1 then
- data[player].title = ""..lang[cmm].title1.."";
- ui.addPopup(2,0,lang[cmm].buys,player,300,175,200)
- data[player].score = data[player].score-1;
- else
- ui.addPopup(2,0,lang[cmm].buye,player,300,175,200)
- end
- if id == 2 and data[player].score >= 5 then
- data[player].title = ""..lang[cmm].title2.."";
- ui.addPopup(2,0,lang[cmm].buys,player,300,175,200)
- data[player].score = data[player].score-5;
- else
- ui.addPopup(2,0,lang[cmm].buye,player,300,175,200)
- end
- if id == 3 and data[player].score >= 25 then
- data[player].title = ""..lang[cmm].title3.."";
- ui.addPopup(2,0,lang[cmm].buys,player,300,175,200)
- data[player].score = data[player].score-25;
- else
- ui.addPopup(2,0,lang[cmm].buye,player,300,175,200)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment