Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variaveis--
- mapas = {6940835,6940872,6939230,6939743,6932947,6931137,6933370,6933386,6939573,6939693,6939230,6939558,6939573,6939583,6939322,6947704,6960338,6960316}
- shaman = ""
- data = {}
- p={}
- time_click = 0;
- vivos = 0;
- message=false
- g_time = 0;
- --Funções--
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAllShamanSkills(true)
- textarea=ui.addTextArea
- function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss)
- --if not backgroundColor then backgroundColor=0x324650 end
- --if not borderColor then borderColor=0x000001 end
- if emboss then
- textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
- textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
- end
- textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
- end
- 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 eventNewPlayer(name)
- system.bindMouse(name,true)
- p[name]={
- rounds=0,
- Mwins=0,
- Swins=0,
- kills=0,
- killer=0,
- killsK=0,
- sp={
- strenght = 20,
- price = 25,
- },
- }
- for i,v in pairs(data) do
- if v[1] == name then
- p[name] = v[2]
- end
- end
- table.insert(data,{name, p[name]})
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><CE>Bem-vindo ao explosion v2.6</CE></N>",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><J>Caso você não esteja vendo a explosão <br>vá em opções e ative os efeitos especiais.</J></N>",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Help]</V> <B><J>Comandos:</J></B><br><BL>→</BL> <VP>!help</VP> - abre a janela de ajuda<br><BL>→</BL> <VP>!ajuda</VP> - abre a janela de ajuda<br><BL>→</BL> <VP>!p</VP> <J>[Nome]</J> - abre o perfil de um jogador, sem o nome abre o seu.",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N>Este minigame foi desenvolvido por <V>Contistente</V> & <V>Rianmojang</V>.</N>",name)
- eventChatCommand(name,'help')
- if not game then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- end
- function eventChatCommand(name, cmd)
- local arg = split(cmd, " ")
- if arg[1] == "help" or arg[1] == "ajuda" then
- tfm.exec.chatMessage("<VP>→</VP> <V>[Help]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- ui.addTextArea(0,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="13">Como jogar',name,310,48,175,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">X</a>',name,466,50,16,16,0x324650,0x324650,nil,true)
- ui.addTextArea(3,"<B><font size='12'>O jogo consiste em um shaman que é o <CE>Matador</CE> ele mata os ratos soltando <VP>explosões</VP> pelo mapa ao <VP>clickar na tela</VP>, e os <CE>Ratos</CE> precisam <R>sobreviver até o tempo acabar</R> para vencer.",name,305,85,190,250,0x0e232b,0x0e232b,nil,true)
- end
- if arg[1] == "shop" then
- tfm.exec.chatMessage("<VP>→</VP> <V>[Shop]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- ui.addTextArea(0,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="13">Loja',name,310,48,175,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">X</a>',name,466,50,16,16,0x324650,0x324650,nil,true)
- ui.addTextArea(3,"<B><font size='12'>",name,305,85,190,250,0x0e232b,0x0e232b,nil,true)
- end
- if arg[1] == "p" then
- tfm.exec.chatMessage("<VP>→</VP> <V>[Profile]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- if arg[2] then
- nome = arg[2]:lower():gsub('%a', string.upper, 1) -- guarda na variavel
- else
- nome = name
- end
- if tfm.get.room.playerList[nome] then
- ui.addTextArea(0,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="13">'..nome,name,310,48,175,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">X</a>',name,466,50,16,16,0x324650,0x324650,nil,true)
- ui.addTextArea(3,"<B><font size='12'>Vezes Jogadas: "..p[nome].rounds.."<br>Vitórias como rato: "..p[nome].Mwins.."<br>Vitórias como matador: "..p[nome].Swins.."<br>Derrotas como rato: "..p[nome].kills.."<br>Derrotas como matador: "..p[nome].killsK.."<br>Vezes Matador: "..p[nome].killer.."",name,305,85,190,250,0x0e232b,0x0e232b,nil,true)
- else
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <R>"..nome.." não se encontra em sala ou não existe.</R>",name)
- end
- end
- end
- function eventPlayerLeft(name)
- if name == shaman and game then
- newMap()
- end
- end
- function newMap()
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- function eventNewGame()
- newShaman()
- time_click = 2;
- tfm.exec.setGameTime(100)
- tfm.exec.snow(100)
- end
- function eventPlayerDied(name)
- vivos=vivos-1;
- p[name].kills = p[name].kills+1;
- if vivos == 1 and g_time > 30000 then
- tfm.exec.setGameTime(31)
- end
- if vivos == 0 then
- jogadores={}
- for i in pairs(tfm.get.room.playerList) do
- table.insert(jogadores,i)
- end
- tfm.exec.setPlayerScore(jogadores[math.random(#jogadores)],16,false)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> O matador <VP>"..shaman.."</VP> é o vencedor.")
- p[shaman].Swins = p[shaman].Swins+1;
- newMap()
- end
- end
- function newShaman()
- vivos=0
- for i,v in pairs(tfm.get.room.playerList) do
- if v.isShaman then
- shaman = i
- end
- vivos=vivos+1;
- tfm.exec.giveMeep(i)
- end
- if vivos > 2 then
- game = true
- for i in pairs(tfm.get.room.playerList) do
- p[i].rounds = p[i].rounds+1;
- end
- p[shaman].killer = p[shaman].killer+1;
- p[shaman].kills = p[shaman].kills-1;
- tfm.exec.killPlayer(shaman)
- tfm.exec.setPlayerScore(shaman,0,false)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><CE>"..shaman.."</CE> é o matador.</N>")
- else
- game = false
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><R>É necessário 3 jogadores.</N>")
- end
- end
- function eventMouse(name,x,y)
- if time_click == 0 and name == shaman and game then
- tfm.exec.explosion (x, y, p[name].sp.strenght, 100, true)
- tfm.exec.displayParticle(12,x,y)
- for i=1,25 do
- tfm.exec.displayParticle(0,x,y,math.random(-5,5),math.random(-5,5))
- end
- time_click = 3
- end
- end
- function eventTextAreaCallback(id,name,link)
- if link=="close" then
- for id=0,30 do
- ui.removeTextArea(id,name)
- ui.removeTextArea(6969+id,name)
- ui.removeTextArea(7979+id,name)
- end
- end
- end
- function eventLoop(t,r)
- g_time = r
- if t >= 3000 then
- if time_click > 0 and game then
- ui.addTextArea(8,'<p align="center"><B><VP>'..time_click,nil,6,380,20,20,0,0,0,true)
- time_click = time_click-1;
- elseif time_click == 0 then
- ui.removeTextArea(8,nil)
- end
- if vivos == 0 then
- newMap()
- vivos=1
- end
- end
- if r < 1000 then
- for i,v in pairs(tfm.get.room.playerList) do
- if not v.isDead and game then
- tfm.exec.giveCheese(i)
- tfm.exec.playerVictory(i)
- p[i].Mwins = p[i].Mwins+1;
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <VP>"..i.."</VP> é o vencedor.")
- p[shaman].killsK = p[shaman].killsK+1;
- end
- end
- vivos=vivos-1;
- end
- end
- for all in pairs(tfm.get.room.playerList) do
- eventNewPlayer(all)
- end
- tfm.exec.setRoomMaxPlayers(25)
- newMap()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement