Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------
- -- @Version: 1.9
- -- @OBS1: Bug da flecha para a esquerda corrigido.
- -- @OBS2: Corrigido, apenas os Hunters jogam as flechas
- -- @OBS3: Adicionado as Abas: Perfil/Help
- ------------------------
- -----------------------
- -- @Variaveis/Objetos/Tabelas
- tfm.exec.chatMessage =print
- tfm.exec.disableAutoShaman()
- newData = {}
- p = {}
- teamtime=false
- ----------------------
- -- <procedure>
- -- Sistema de teams
- -- @Define se o jogador é do time red ou blue.
- ----------------------
- function eventNewGame()
- for p,n in pairs(tfm.get.room.playerList) do
- if teamtime == false then
- newData[p].Team = "Monster"
- tfm.exec.setNameColor(p, 0xCB546B) -- color red
- tfm.exec.chatMessage("<R><i>Você nasceu como um Monster! Corra dos caçadores!!</i>",p)
- teamtime=true
- else
- newData[p].Team = "Hunter"
- tfm.exec.setNameColor(p, 0x2F7FCC)
- tfm.exec.chatMessage("<BV><i>Você nasceu como um caçador! Vá atrás dos Monsters!!</i>",p)
- teamtime=false
- end
- newData[p].Life = 100
- LifeStatus(p)
- end
- end
- -------------------------------------------------
- -- @Local de armazenamento de dados dos jogadores.
- -- @
- --------------------------------------------------
- function eventNewPlayer(name)
- newData[name] = {
- Team = "",
- Xp = 0,
- Life = 100,
- winHunter = 0,
- winMonster = 0,
- }
- -------------------------------
- -- @ Sistema de jogar flechas
- -- @ Os caçadores atiram flechas
- --------------------------------
- function balls(name)
- if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
- info[p].time = os.time()
- tfm.exec.movePlayer(p,0,0,true,100,0,false)
- elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
- info[p].time = os.time()
- tfm.exec.movePlayer(p,0,0,true,-100,0,false)
- end
- local facingLeft = {}
- for name in pairs(tfm.get.room.playerList) do
- for _,key in pairs{0,2,3,32} do system.bindKeyboard(name, key, true)
- end
- end
- function eventKeyboard(name, key, down, x, y)
- if key == 3 then
- if newData[name].Team ~= "Monster" then
- if tfm.get.room.playerList[name].isFacingRight then
- tfm.exec.addShamanObject(35, x+20, y, 0, 20)
- else
- tfm.exec.addShamanObject(35, x-20, y, 0, -20)
- end
- else
- eventKeyboard(name,32,down,x,y)
- end
- end
- if key == 32 and newData[name].Team == "Monster" then
- for n,player in pairs(tfm.get.room.playerList) do
- if name ~= n and newData[n].Team ~= "Monster" and newData[n].Life ~= 0 and x >= player.x - 15 and x <= player.x + 15 and y >= player.y - 15 and y <= player.y + 15 then
- newData[n].Life = newData[n].Life - math.random(1,5)
- tfm.exec.displayParticle(5,x,y,-0.2,-0.2,0,0)
- LifeStatus(n)
- break
- end
- end
- end
- end
- end
- balls("Hpassos")
- -----------------------
- -- @TextAreas do jogo.
- -- @TextAras do Xp/Mana
- -----------------------
- -- @TextAra dos dados dos player [Profile] / [Help]
- LifeStatus(name)
- ui.addTextArea(2, "", name, 771, 374, 20, 17, 0x006191, 0x006191, 0.8, true)
- ui.addTextArea(3, "<p align='center'><a href='event:help'>H</a></p>", name, 772, 372, 22, 20, 0x324650, 0x324650, 0.4, true)
- ui.addTextArea(4, "", name, 730, 374, 20, 17, 0x006191, 0x006191, 0.8, true)
- ui.addTextArea(5, "<p align='center'><a href='event:profile'>P</a></p>", name, 731, 372, 22, 20, 0x324650, 0x324650, 0.4, true)
- end
- ----
- function eventTextAreaCallback(t,p,link)
- if link == [[profile]] then
- ui.addTextArea(40, "", p, 226, 37, 306, 205, 0x313a4a, 0x313a4a, 1, true)
- ui.addTextArea(41, "<font size='15'><p align='center'>"..p.."<b></p>", p, 226, 37, 306, 25, 0x2c3438, 0x2c3438, 1, true)
- ui.addTextArea(42, "Ganhas como Hunter", p, 233, 76, 132, 20, 0x313a4a, 0x313a4a, 1, true)
- ui.addTextArea(43, "<font size='15'><p align='center'>"..newData[p].winHunter.."/1000<b></p>", p, 228, 102, 166, 22, 0x375361, 0x2c3438, 1, true)
- ui.addTextArea(44, "Ganhas como Monsters", p, 226, 142, 141, 20, 0x313a4a, 0x313a4a, 1, true)
- ui.addTextArea(45, "<font size='15'><p align='center'>"..newData[p].winMonster.."/1000<b></p>", p, 230, 173, 166, 22, 0x375361, 0x2c3438, 1, true)
- ui.addTextArea(46, "Title", p, 427, 76, 100, 20, 0x313a4a, 0x313a4a, 1, true)
- ui.addTextArea(47, "<font size='15'><p align='center'><b></p>", p, 416, 102, 109, 26, 0x375361, 0x2c3438, 1, true)
- ui.addTextArea(48, "[...]", p, 419, 140, 108, 20, 0x313a4a, 0x313a4a, 1, true)
- ui.addTextArea(49, "<font size='15'><p align='center'><b></p>", p, 418, 173, 108, 24, 0x375361, 0x2c3438, 1, true)
- ui.addTextArea(50, "<font size='15'><a href='event:closeprofile'><b>X</a>", p, 550, 37, 28, 30, 0x2c3438, 0x2c3438, 0, true)
- elseif link == [[closeprofile]] then
- for i = 40,50 do --
- ui.removeTextArea(i,p)
- end
- elseif link ==[[help]] then
- ui.addTextArea(100, "", p, 139, 95, 520, 207, 0x313a4a, 0x313a4a, 1, true)
- ui.addTextArea(101, "", p, 140, 97, 520, 25, 0x2c3438, 0x2c3438, 1, true)
- ui.addTextArea(102, "", p, 139, 278, 520, 25, 0x2c3438, 0x2c3438, 1, true)
- ui.addTextArea(103, "<font size='15'>Olá sejam bem-vindos ao #DeadlyHunt, sua missão aqui é:\n <R>Se você é um Monstro.:</R>Você deve ir proximo aos caçadores e se abaixar para tirar o Hp deles, quando o HP chegar a 0 eles morrem.\n<BV>Se você é um Caçador.:</bv> Você deve atirar suas flechas para matar os monstros, antes que eles os matem!! Mas cuidado,\n suas flechas também dão matam seus parceiros de equipe.</font>", nil, 156, 126, 488, 156, 0x2c3438, 0x2c3438, 1, true)
- ui.addTextArea(104, "<a href='event:closehelp'><b>X</a>", p, 628, 98, 28, 30, 0x2c3438, 0x2c3438, 0, true)
- elseif link == [[closehelp]] then
- for i = 100,104 do
- ui.removeTextArea(i,p)
- end
- end
- end
- ------------------------
- -- @Vida
- --@
- ------------------------
- function LifeStatus(name)
- if newData[name].Team ~= "Monster" then
- if newData[name].Life <= 0 then
- newData[name].Life = 0
- tfm.exec.killPlayer(name)
- end
- ui.addTextArea(0, "", name, 254, 372, 220, 10, 0x006191, 0x006191, 1, true)
- ui.addTextArea(1, "<p align='center'>"..(newData[name].Life*100/100).."/100</p>", name, 252, 368, 226, 18, 0x324650, 0x000000, 0.4, true)
- else
- ui.removeTextArea(0,name)ui.removeTextArea(1,name)
- end
- end
- tfm.exec.newGame(7303153)
- ui.setMapName("DeadlyHunt")
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement