Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------
- -- @Alguns valores de armazenamento e dados.
- -- @Desabilita algumas funções do jogo.
- -----------------------------
- for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'MortCommand', 'AutoScore'} do
- tfm.exec['disable' .. v]()
- end
- -- @Alguns outros valores.
- newData = {}
- tempo = os.time()
- maps = {0}
- p = 0
- agents=0
- criminals=0
- proom = 0
- tfm.exec.chatMessage = print
- -- @Inicio do jogo
- StartTime=false
- startGame=false
- -- @TextAre de menu
- ui.addTextArea(100, "<a href='event:menu'><font size='15'><B>Menu</font></a>", name, 8, 27, 53, 26, 0x0B3861, 0x086A87, 1, true)
- ---------------------------------
- -- @Função jogador entra na sala.
- ---------------------------------
- function eventNewPlayer(name)
- proom=proom+1
- newData[name] = {
- Team = "",
- XP = 0,
- Level = 0,
- Life = 100,
- lang = "",
- tempo = os.time(),
- }
- ---------------------------------
- -- @Quantia de players necessarias para iniciar a partida.
- -- @Dar incio ao jogo/ sai do lobby
- ---------------------------------
- if proom < 4 then
- ui.setMapName("<CE>Precisa de mais jogadores para começar o jogo</CE>")
- end
- if (not startGame) then
- if (proom >= 1) then
- tempo = 20
- startTime=true
- end
- end
- ---------------------------------
- -- @Função novo jogo.
- -- @Seleção de equipes.
- ---------------------------------
- function eventNewGame()
- agents = 0
- criminals = 0
- teamtime = math.random(0,1)
- for p,n in pairs(tfm.get.room.playerList) do
- if teamtime == 0 then
- newData[p].Team = "Criminal"
- tfm.exec.chatMessage("Você é um criminoso altamente perigoso, ache e ataque os agentes secretos antes que eles prendam você.",p)
- teamtime=1
- criminals=criminals+1
- else
- newData[p].Team = "Agent"
- tfm.exec.chatMessage("Você é um agente secreto! Encontre os bandidos e prenda-os.",p)
- newData[p].Life = 100
- teamtime=0
- agents=agents+1
- end
- LifeStatus(p)
- end
- end
- ---------------------------------
- -- @Funções relacionadas aos poderes dos jogadores.
- ---------------------------------
- function others(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
- end
- -- Aqui, isso aqui não funciona ↓ ;-;
- function eventKeyboard(name, key, down, x, y)
- if key == 32 and newData[name].Team == "Criminal" or "Agent" then
- for n,player in pairs(tfm.get.room.playerList) do
- if name ~= n and newData[n].Team == "Criminal" 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(0,5)
- tfm.exec.displayParticle(5,x,y,-0.2,-0.2,0,0)
- print("Foto capturada Criminal")
- LifeStatus(n)
- if name ~= n and newData[n].Team == "Agent" 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(0,5)
- tfm.exec.displayParticle(5,x,y,-0.2,-0.2,0,0)
- print("Foto capturada Agent")
- LifeStatus(n)
- break
- end
- end
- end
- end
- end
- ---------------------------------
- -- @TextAreas do jogo
- ---------------------------------
- function eventTextAreaCallback(t,p,link)
- if link == [[menu]] then
- ui.addTextArea(0, "", p, 8, 27, 286, 26, 0x086A87, 0x0B3861, 1, true)
- ui.addTextArea(1, "<a href='event:profile'><font size='15'><B>Profile</font></a>", p, 75, 29, 64, 20, 0x0B3861, 0x086A87, 1, true)
- ui.addTextArea(2, "<a href='event:close_menu'><font size='20'><B><R>X</font></a>", p, 273, 27, 25, 26, 0x324650, 0x000000, 0, true)
- ui.addTextArea(3, "<a href='event:menu'><font size='15'><B>Menu</font></a>", p, 8, 27, 53, 26, 0x0B3861, 0x086A87, 1, true)
- elseif link == [[close_menu]] then
- for i = 0,2 do --
- ui.removeTextArea(i,p)
- end
- elseif link == [[profile]] then
- ui.addTextArea(100, "", p, 230, 83, 340, 236, 0x0B3861, 0x0e242d, 1, true)
- ui.addTextArea(101, "", p, 230, 72, 340, 26, 0x086A87, 0x0e242d, 1, true)
- ui.addTextArea(102, "<p align='center'><font size='15'><a href='event:close_profile'><b><R>X</b></a></a></p>", p, 542, 72, 27, 47, 0x0e242d, 0x0e242d, 0, true)
- ui.addTextArea(103, "<p align='center'><font size='15'><a href='event:profile'><VP><b>Agent</b></a></p>", p, 230, 72, 71, 26, 0x0e242d, 0x3c5064, 0, true)
- ui.addTextArea(104, "<p align='center'><font size='15'><a href='event:CriminalProfile'><b>Criminal</b></a></a></p>", p, 300, 72, 117, 23, 0x0e242d, 0x3c5064, 0, true)
- ui.addTextArea(105, "<font size='15'><p align='center'>Criminal´s Kills</p></font>", p, 237, 116, 210, 24, 0x086A87, 0x0e242d, 1, true)
- ui.addTextArea(106, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 150, 210, 24, 0x183d4d, 0x3c5064, 0, true)
- ui.addTextArea(107, "<font size='15'><p align='center'>Round Players</p></font>", p, 237, 180, 210, 23, 0x086A87, 0x0e242d, 1, true)
- ui.addTextArea(108, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 215, 210, 24, 0x183d4d, 0x3c5064, 0, true)
- ui.addTextArea(109, "<font size='15'><p align='center'>Won Round</p></font>", p, 237, 247, 210, 23, 0x086A87, 0x0e242d, 1, true)
- ui.addTextArea(110, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 281, 210, 24, 0x183d4d, 0x3c5064, 0, true)
- for i = 0,2 do --
- ui.removeTextArea(i,p)
- end
- elseif link == [[close_profile]] then
- for i = 100,110 do --
- ui.removeTextArea(i,p)
- end
- elseif link == [[CriminalProfile]] then
- ui.addTextArea(100, "", p, 230, 83, 340, 236, 0x0b3861, 0x0e242d, 1, true)
- ui.addTextArea(101, "", p, 230, 72, 340, 26, 0x086a87, 0x0e242d, 1, true)
- ui.addTextArea(102, "<p align='center'><font size='15'><a href='event:close_profile'><b><R>X</b></a></a></p>", p, 542, 72, 27, 47, 0x0e242d, 0x0e242d, 0, true)
- ui.addTextArea(103, "<p align='center'><font size='15'><a href='event:profile'><b>Agent</b></a></p>", p, 230, 72, 71, 26, 0x0e242d, 0x3c5064, 0, true)
- ui.addTextArea(104, "<p align='center'><font size='15'><R><a href='event:CriminalProfile'><b>Criminal</b></a></a></p>", p, 300, 72, 117, 23, 0x0e242d, 0x3c5064, 0, true)
- ui.addTextArea(105, "<font size='15'><p align='center'>Murdered agents</p></font>", p, 237, 116, 210, 24, 0x086a87, 0x0e242d, 1, true)
- ui.addTextArea(106, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 150, 210, 24, 0x183d4d, 0x3c5064, 0, true)
- ui.addTextArea(107, "<font size='15'><p align='center'>Round Players</p></font>", p, 237, 180, 210, 23, 0x086a87, 0x0e242d, 1, true)
- ui.addTextArea(108, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 215, 210, 24, 0x183d4d, 0x3c5064, 0, true)
- ui.addTextArea(109, "<font size='15'><p align='center'>Won Round</p></font>", p, 237, 247, 210, 23, 0x086a87, 0x0e242d, 1, true)
- ui.addTextArea(110, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 281, 210, 24, 0x183d4d, 0x3c5064, 0, true)
- end
- end
- ---------------------------------
- -- @Função da vida do jogador.
- ---------------------------------
- function LifeStatus(name)
- if newData[name].Team == "Criminal" or "Agent" then
- if newData[name].Life <= 0 then
- newData[name].Life = 0
- tfm.exec.killPlayer(name)
- end
- local cod = ""
- local cod1 = 226
- if newData[name].Life > 100 then
- cod = "<R>"
- else
- cod = ""
- end
- local teamColor = newData[name].Team == "Agent" and 0x006191 or 0xCB546B
- ui.addTextArea(800, "", name, 254, 372, (newData[name].Life*2.1), 10, teamColor, teamColor, 1, true)
- ui.addTextArea(801, "<p align='center'>"..cod..""..newData[name].Life.."/100</p>", name, 252, 368, cod1, 18, 0x324650, 0x000000, 0.4, true)
- else
- ui.removeTextArea(800,name)ui.removeTextArea(801,name)
- end
- end
- ---------------------------------
- -- @Função levelup.
- ---------------------------------
- function levelUP(name,xp)
- newData[name].XP = newData[name].xp + 10
- if newData[name].XP >= 100 then
- newData[name].Level = newData[name].Level + 1
- newData[name].XP = 0
- end
- end
- ---------------------------------
- -- @Jogador morre
- ---------------------------------
- function eventPlayerDied(name)
- if newData[name].Life > 0 then
- tfm.exec.respawnPlayer(name)
- newData[name].Life = newData[name].Life - 10
- LifeStatus(name)
- end
- if newData[name].Life <= 0 then
- tfm.exec.killPlayer(name)
- tfm.exec.chatMessage("<B>Sua energia chegou ao fim! </B>:(", name)
- end
- end
- ---------------------------------
- -- @Função jogador sai da sala.
- ---------------------------------
- function eventPlayerLeft(name)
- p=p-1
- if p < 2 then
- tfm.exec.newGame("#1")
- startGame = false
- startTime = false
- end
- end
- ---------------------------------
- ---------------------------------
- end -- end da função new player
- tfm.exec.newGame('<C><P L="1600" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="1545" o="ff8900" X="801" c="4" Y="68" T="12" H="85" /><S H="85" L="1545" o="df7800" X="800" c="4" Y="153" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="85" L="1545" o="9b5300" X="802" c="4" Y="322" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="1545" o="c26801" X="799" c="4" Y="237" T="12" H="85" /><S P="0,0,0,0.2,0,0,0,0" L="30" o="ffd700" X="16" Y="198" T="12" H="402" /><S L="30" o="ffcb00" X="1585" H="402" Y="200" T="12" P="0,0,0,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="1600" o="ffcb00" X="800" Y="383" T="12" H="40" /><S L="1600" o="ffcb00" X="799" H="30" Y="12" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="21" o="ffcb00" X="802" Y="196" T="12" H="339" /></S><D /><O /></Z></C>')
- tfm.exec.setGameTime(9999999999)
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement