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,6961814,6954653}
- shaman = ""
- data = {}
- p={}
- translations = {
- br = {
- name = "br",
- welcome = "<CE>Bem-vindo ao explosion v3.0</CE>",
- commands = "<B><J>Comandos:</J></B><br>!help - abre a janela de ajuda.<br>!p <V>[Nome]</V> - abre o perfil de um jogador e sem o nome abre o seu.<br>!rank - abre o ranking do jogo.",
- developers = "Minigame criado por <V>Contistente</V> & <V>Rianmojang</V>.",
- topic = "<VP>Acesse o nosso tópico do fórum:<br>http://atelier801.com/topic?f=6&t=839504&p=1</VP>",
- window_help = "<B><J><p align='center'><font size='15'>Centro de ajuda",
- text_help = "O jogo consiste em um assassino que deve matar todos os ratos clicando na tela para soltar um explosão, e para que os ratos sejam vencedores devem sobreviver até o tempo acabar.",
- close = "<R><B><p align='center'><font size='12'><a href='event:close'>Fechar</a>",
- not_room_player = " não está na sala.",
- tribe = "Tribo",
- mouse = "Rato",
- community = "Comunidade",
- rounds = "Rodadas Jogadas",
- wins = "Vitórias",
- losers = "Derrotas",
- killer = "Assassino",
- learderboard = "Ranking",
- winner = "é o vencedor.",
- not_game = "É preciso 3 jogadores para iniciar o jogo.",
- new_killer = "é o assassino.",
- legend_name = "Legenda do ranking:",
- legend_vcr = "Vitórias como rato.",
- legend_dcr = "Derrotas como rato.",
- legend_vca = "Vitórias como assassino.",
- legend_dca = "Derrotas como assasino.",
- },
- en = {
- name = "en",
- welcome = "<CE>Welcome to explosion v3.0</CE>",
- commands = "<B><J>Commands:</J></B><br>!help - open the help window.<br>!p <V>[Name]</V> - open the profile of a player and with no name open your profile.<br>!rank open the ranking of the game.",
- developers = "Minigame created by <V>Contistente</V> & <V>Rianmojang</V>.",
- topic = "<VP>Acess our topic in the forum:<br>http://atelier801.com/topic?f=6&t=839504&p=1</VP>",
- window_help = "<B><J><p align='center'><font size='15'>Help center",
- text_help = "The game consists of a killer who must kill all the rats by clicking on the screen to release an explosion, and for the rats to be winners they must survive until time runs out.",
- close = "<R><B><p align='center'><font size='12'><a href='event:close'>Close</a>",
- not_room_player = " is not in the room.",
- tribe = "Tribe",
- mouse = "Mouse",
- community = "Community",
- rounds = "Rounds played",
- wins = "Wins",
- losers = "Losers",
- killer = "Killer",
- learderboard = "Learderboard",
- winner = "is the winner.",
- not_game = "It takes 3 players to start the game.",
- new_killer = "is the killer.",
- legend_name = "Ranking subtitle:",
- legend_vcr = "Wins as a mouse",
- legend_dcr = "Defeats as a mouse",
- legend_vca = "Wins as a killer",
- legend_dca = "Defeats as a killer",
- }
- }
- skip = 0
- time_click = 0;
- vivos = 0;
- message=false
- g_time = 0;
- --Funções--
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAllShamanSkills(true)
- 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)
- p[name]={
- rounds=0,
- Mwins=0,
- Swins=0,
- kills=0,
- killer=0,
- killsK=0,
- kSkip=0,
- lang = "",
- skiped=false,
- }
- trans = false
- for i,v in pairs(translations) do
- print(v.name)
- if v.name == tfm.get.room.playerList[name].community then
- trans = true
- p[name].lang = v.name
- end
- end
- if not trans then
- lang = "en"
- end
- system.bindMouse(name,true)
- 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(translations[p[name].lang].welcome,name)
- tfm.exec.chatMessage(translations[p[name].lang].commands,name)
- tfm.exec.chatMessage(translations[p[name].lang].developers,name)
- tfm.exec.chatMessage(translations[p[name].lang].topic,name)
- eventChatCommand(name,'help')
- if not game then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- 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 eventChatCommand(name, cmd)
- local arg = split(cmd, " ")
- if arg[1] == "help" then
- ui.addTextArea(3,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(4,translations[p[name].lang].window_help,name,295,40,210,30,nil,0x2e424d,nil,true)
- ui.addTextArea(5,'<font size="11"><B>'..translations[p[name].lang].text_help,name,305,85,190,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(6,translations[p[name].lang].close,name,305,320,190,20,0x3c5063,0x3c5063,nil,true)
- end
- if arg[1] == "p" then
- 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,250,40,300,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="16"><p align="center">'..nome,name,245,35,310,30,nil,0x2e424d,nil,true)
- ui.addTextArea(2,"<font size='12'>"..translations[p[name].lang].tribe.." : <J>"..tfm.get.room.playerList[nome].tribeName.."</J><br>"..translations[p[name].lang].community.." : <V>"..tfm.get.room.playerList[nome].community.."</V><br><br><font size='15'>"..translations[p[name].lang].mouse.."</font><br><font color='#6a7495'> • "..translations[p[name].lang].rounds.." : </font> <V>"..p[nome].rounds.."</V><br><font color='#6a7495'> • "..translations[p[name].lang].wins.." : </font> <V>"..p[nome].Mwins.."</V><br><font color='#6a7495'> • "..translations[p[name].lang].losers.." : </font> <V>"..p[nome].kills.."<br><br><font size='15'><N>"..translations[p[name].lang].killer.."</N></font><br><font color='#6a7495'> • "..translations[p[name].lang].rounds.." : </font> <V>"..p[nome].killer.."</V><br><font color='#6a7495'> • "..translations[p[name].lang].wins.." : </font> <V>"..p[nome].Swins.."</V><br><font color='#6a7495'> • "..translations[p[name].lang].losers.." : </font> <V>"..p[nome].killsK.."",name,255,80,290,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(-1,translations[p[name].lang].close,name,255,315,290,20,0x3c5063,0x3c5063,nil,true)
- else
- tfm.exec.chatMessage("<R>"..nome..""..translations[p[name].lang].not_room_player.."</R>",name)
- end
- end
- if arg[1] == "rank" then
- eventRanking(name)
- 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;
- if game then
- p[name].kills = p[name].kills+1;
- end
- if vivos == 1 and g_time > 30000 then
- tfm.exec.setGameTime(31)
- end
- if vivos == 0 and game then
- for i in pairs(tfm.get.room.playerList) do
- tfm.exec.chatMessage("<CH>"..i.."</CH> "..translations[p[i].lang].winner,i)
- end
- 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
- skip = 0
- end
- vivos=vivos+1;
- end
- if vivos > 2 then
- game = true
- for i in pairs(tfm.get.room.playerList) do
- if i ~= shaman then
- p[i].rounds = p[i].rounds+1;
- end
- p[i].skiped = false
- tfm.exec.giveMeep(i)
- 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)
- for i in pairs(tfm.get.room.playerList) do
- tfm.exec.chatMessage("<VP>"..i.."</VP> "..translations[p[i].lang].new_killer,i)
- end
- else
- game = false
- for i in pairs(tfm.get.room.playerList) do
- tfm.exec.chatMessage("<R>"..translations[p[i].lang].not_game,i)
- end
- end
- end
- function eventMouse(name,x,y)
- if time_click == 0 and name == shaman and game then
- tfm.exec.explosion (x, y, math.random(20,40), 100, true)
- tfm.exec.displayParticle(12,x,y)
- for i=1,25 do
- tfm.exec.displayParticle(0,x,y,math.random(-6,6),math.random(-6,6))
- end
- time_click = 2
- end
- end
- function eventTextAreaCallback(id,name,link)
- if link=="close" then
- for id=-1,61 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>'..math.floor(time_click/2),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 and game then
- w = ''
- 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;
- w = i
- p[shaman].killsK = p[shaman].killsK+1;
- end
- end
- if w ~= '' then
- for i in pairs(tfm.get.room.playerList) do
- tfm.exec.chatMessage("<VP>"..i.."</VP> "..translations[p[i].lang].winner,i)
- end
- end
- vivos=vivos-1;
- end
- end
- function eventRanking(name)
- tfm.exec.chatMessage("<R><B>"..translations[p[name].lang].legend_name.."</B></R><br>VCR - "..translations[p[name].lang].legend_vcr..".<br>DCR - "..translations[p[name].lang].dcr..".<br>VCA - "..translations[p[name].lang].vca..".<br>DCA - "..translations[p[name].lang].dca..".",name)
- local sc = {}
- ids = {}
- for name, player in pairs(tfm.get.room.playerList) do
- sc[#sc+1] = {n=name,s=player.score,r=p[name].rounds,vcr=p[name].Mwins,dcr=p[name].kills,vca=p[name].Swins,dca=p[name].killsK}
- end
- table.sort(sc,function(a,b) return a.dca>b.dca end)
- table.sort(sc,function(a,b) return a.vca>b.vca end)
- table.sort(sc,function(a,b) return a.dcr>b.dcr end)
- table.sort(sc,function(a,b) return a.vcr>b.vcr end)
- y = 20
- id = 50
- ui.addTextArea(0,"",name,120,45,500,340,nil,0x324650,nil,true)
- ui.addTextArea(1,'<p align="center"><B><J><font size="13">'..translations[p[name].lang].learderboard,name,130,48,475,20,nil,0x324650,nil,true)
- ui.addTextArea(2,translations[p[name].lang].close,name,130,360,475,20,0x3c5063,0x3c5063,nil,true)
- str=''
- for k,v in pairs(sc) do
- if k < 11 then
- id = id+1;
- table.insert(ids, id)
- y = y+35
- str = "<N><J>"..k.."°</J> | <V>"..v.n.."</V> | Rodadas: <V>"..v.r.."</V> | VCR: <V>"..v.vcr.."</V> | DCR: <V>"..v.dcr.."</V> | VCA: <V>"..v.vca.."</V> | DCA: <V>"..v.dca.."</V></N><br>"
- ui.addTextArea(id,str,name,130,y+30,475,20,0x0e232b,0x0e232b,nil,true)
- end
- end
- return str
- end
- for all in pairs(tfm.get.room.playerList) do
- eventNewPlayer(all)
- end
- tfm.exec.setRoomMaxPlayers(30)
- newMap()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement