Advertisement
Novohp

New blacklist 1.5.4

Jul 17th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.27 KB | None | 0 0
  1. -----------------------------
  2. -- @Alguns valores de armazenamento e dados.
  3. -- @Desabilita algumas funções do jogo.
  4. -----------------------------  
  5. for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'MortCommand', 'AutoScore'} do
  6.     tfm.exec['disable' .. v]()
  7. end
  8. -- @Alguns outros valores.
  9. newData = {}
  10. tempo = os.time()
  11. maps = {0}
  12. p = 0
  13. agents=0
  14. criminals=0
  15. proom = 0
  16. tfm.exec.chatMessage = print
  17. -- @Inicio do jogo
  18. StartTime=false
  19. startGame=false
  20. -- @TextAre de menu
  21. ui.addTextArea(100, "<a href='event:menu'><font size='15'><B>Menu</font></a>", name, 8, 27, 53, 26, 0x0B3861, 0x086A87, 1, true)
  22. ---------------------------------
  23. -- @Função jogador entra na sala.
  24. ---------------------------------
  25. function eventNewPlayer(name)
  26.     proom=proom+1
  27.     newData[name] = {
  28.         Team = "",
  29.         XP = 0,
  30.         Level = 0,
  31.         Life = 100,
  32.         lang = "",
  33.         tempo = os.time(),
  34.     }
  35. ---------------------------------
  36. -- @Quantia de players necessarias para iniciar a partida.
  37. -- @Dar incio ao jogo/ sai do lobby
  38. ---------------------------------
  39. if proom < 4 then
  40.   ui.setMapName("<CE>Precisa de mais jogadores para começar o jogo</CE>")
  41. end
  42.     if (not startGame) then
  43.        if (proom >= 1) then
  44.           tempo = 20
  45.               startTime=true
  46.         end
  47.     end
  48. ---------------------------------
  49. -- @Função novo jogo.
  50. -- @Seleção de equipes.
  51. ---------------------------------
  52. function eventNewGame()
  53.     agents = 0
  54.     criminals = 0
  55.     teamtime = math.random(0,1)
  56.     for p,n in pairs(tfm.get.room.playerList) do
  57.         if teamtime == 0 then
  58.             newData[p].Team = "Criminal"
  59.             tfm.exec.chatMessage("Você é um criminoso altamente perigoso, ache e ataque os agentes secretos antes que eles prendam você.",p)
  60.             teamtime=1
  61.             criminals=criminals+1
  62.         else
  63.             newData[p].Team = "Agent"
  64.             tfm.exec.chatMessage("Você é um agente secreto! Encontre os bandidos e prenda-os.",p)
  65.             newData[p].Life = 100
  66.             teamtime=0
  67.             agents=agents+1
  68.         end
  69.         LifeStatus(p)
  70.     end
  71. end
  72. ---------------------------------
  73. -- @Funções relacionadas aos poderes dos jogadores.
  74. ---------------------------------
  75. function others(name)
  76.   if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
  77.     info[p].time = os.time()
  78.     tfm.exec.movePlayer(p,0,0,true,100,0,false)
  79.   elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
  80.     info[p].time = os.time()
  81.     tfm.exec.movePlayer(p,0,0,true,-100,0,false)
  82.   end
  83.  
  84.   local facingLeft = {}
  85.  
  86.   for name in pairs(tfm.get.room.playerList) do
  87.     for _,key in pairs{0,2,3,32} do
  88.       system.bindKeyboard(name, key, true)
  89.     end
  90.   end
  91. end
  92. -- Aqui, isso aqui não funciona ↓ ;-;
  93. function eventKeyboard(name, key, down, x, y)
  94.   if key == 32 and newData[name].Team == "Criminal" or "Agent" then
  95.     for n,player in pairs(tfm.get.room.playerList) do
  96.       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
  97.         newData[n].Life = newData[n].Life - math.random(0,5)
  98.         tfm.exec.displayParticle(5,x,y,-0.2,-0.2,0,0)
  99.         print("Foto capturada Criminal")  
  100.         LifeStatus(n)
  101.       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
  102.         newData[n].Life = newData[n].Life - math.random(0,5)
  103.         tfm.exec.displayParticle(5,x,y,-0.2,-0.2,0,0)  
  104.         print("Foto capturada Agent")  
  105.         LifeStatus(n)
  106.         break
  107.       end
  108.     end
  109.   end
  110. end
  111. end
  112. ---------------------------------
  113. -- @TextAreas do jogo
  114. ---------------------------------
  115. function eventTextAreaCallback(t,p,link)
  116.     if link == [[menu]] then
  117.         ui.addTextArea(0, "", p, 8, 27, 286, 26, 0x086A87, 0x0B3861, 1, true)
  118.         ui.addTextArea(1, "<a href='event:profile'><font size='15'><B>Profile</font></a>", p, 75, 29, 64, 20, 0x0B3861, 0x086A87, 1, true)
  119.         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)
  120.         ui.addTextArea(3, "<a href='event:menu'><font size='15'><B>Menu</font></a>", p, 8, 27, 53, 26, 0x0B3861, 0x086A87, 1, true)
  121.     elseif link == [[close_menu]] then
  122.         for i = 0,2 do --
  123.             ui.removeTextArea(i,p)
  124.         end
  125.     elseif link == [[profile]] then
  126.         ui.addTextArea(100, "", p, 230, 83, 340, 236, 0x0B3861, 0x0e242d, 1, true)
  127.         ui.addTextArea(101, "", p, 230, 72, 340, 26, 0x086A87, 0x0e242d, 1, true)
  128.         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)
  129.         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)
  130.         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)
  131.         ui.addTextArea(105, "<font size='15'><p align='center'>Criminal´s Kills</p></font>", p, 237, 116, 210, 24, 0x086A87, 0x0e242d, 1, true)
  132.         ui.addTextArea(106, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 150, 210, 24, 0x183d4d, 0x3c5064, 0, true)
  133.         ui.addTextArea(107, "<font size='15'><p align='center'>Round Players</p></font>", p, 237, 180, 210, 23, 0x086A87, 0x0e242d, 1, true)
  134.         ui.addTextArea(108, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 215, 210, 24, 0x183d4d, 0x3c5064, 0, true)
  135.         ui.addTextArea(109, "<font size='15'><p align='center'>Won Round</p></font>", p, 237, 247, 210, 23, 0x086A87, 0x0e242d, 1, true)
  136.         ui.addTextArea(110, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 281, 210, 24, 0x183d4d, 0x3c5064, 0, true)
  137.         for i = 0,2 do --
  138.             ui.removeTextArea(i,p)
  139.         end
  140.     elseif link == [[close_profile]] then
  141.         for i = 100,110 do --
  142.             ui.removeTextArea(i,p)
  143.         end
  144.     elseif link == [[CriminalProfile]] then
  145.         ui.addTextArea(100, "", p, 230, 83, 340, 236, 0x0b3861, 0x0e242d, 1, true)
  146.         ui.addTextArea(101, "", p, 230, 72, 340, 26, 0x086a87, 0x0e242d, 1, true)
  147.         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)
  148.         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)
  149.         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)
  150.         ui.addTextArea(105, "<font size='15'><p align='center'>Murdered agents</p></font>", p, 237, 116, 210, 24, 0x086a87, 0x0e242d, 1, true)
  151.         ui.addTextArea(106, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 150, 210, 24, 0x183d4d, 0x3c5064, 0, true)
  152.         ui.addTextArea(107, "<font size='15'><p align='center'>Round Players</p></font>", p, 237, 180, 210, 23, 0x086a87, 0x0e242d, 1, true)
  153.         ui.addTextArea(108, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 215, 210, 24, 0x183d4d, 0x3c5064, 0, true)
  154.         ui.addTextArea(109, "<font size='15'><p align='center'>Won Round</p></font>", p, 237, 247, 210, 23, 0x086a87, 0x0e242d, 1, true)
  155.         ui.addTextArea(110, "<font size='15'><p align='center'>0/1000</p></font>", p, 237, 281, 210, 24, 0x183d4d, 0x3c5064, 0, true)
  156.     end
  157. end
  158. ---------------------------------
  159. -- @Função da vida do jogador.
  160. ---------------------------------
  161. function LifeStatus(name)
  162.     if newData[name].Team == "Criminal" or "Agent" then
  163.         if newData[name].Life <= 0 then
  164.             newData[name].Life = 0
  165.             tfm.exec.killPlayer(name)
  166.         end
  167.         local cod = ""
  168.         local cod1 = 226
  169.         if newData[name].Life > 100 then
  170.             cod = "<R>"
  171.         else
  172.             cod = ""
  173.         end
  174.         local teamColor = newData[name].Team == "Agent" and 0x006191 or 0xCB546B
  175.         ui.addTextArea(800, "", name, 254, 372, (newData[name].Life*2.1), 10, teamColor, teamColor, 1, true)
  176.         ui.addTextArea(801, "<p align='center'>"..cod..""..newData[name].Life.."/100</p>", name, 252, 368, cod1, 18, 0x324650, 0x000000, 0.4, true)
  177.     else
  178.         ui.removeTextArea(800,name)ui.removeTextArea(801,name)
  179.     end
  180. end
  181. ---------------------------------
  182. -- @Função levelup.
  183. ---------------------------------
  184. function levelUP(name,xp)
  185.     newData[name].XP = newData[name].xp + 10
  186.     if newData[name].XP >= 100 then
  187.         newData[name].Level = newData[name].Level + 1
  188.         newData[name].XP = 0
  189.     end
  190. end
  191. ---------------------------------
  192. -- @Jogador morre
  193. ---------------------------------
  194. function eventPlayerDied(name)
  195.     if newData[name].Life > 0 then
  196.         tfm.exec.respawnPlayer(name)
  197.         newData[name].Life = newData[name].Life - 10
  198.         LifeStatus(name)
  199.     end
  200.     if newData[name].Life <= 0 then
  201.         tfm.exec.killPlayer(name)
  202.         tfm.exec.chatMessage("<B>Sua energia chegou ao fim! </B>:(", name)
  203.     end
  204. end
  205.  
  206. ---------------------------------
  207. -- @Função jogador sai da sala.
  208. ---------------------------------
  209. function eventPlayerLeft(name)
  210.     p=p-1
  211.     if p < 2 then
  212.         tfm.exec.newGame("#1")
  213.             startGame = false
  214.             startTime = false
  215.   end
  216. end
  217. ---------------------------------
  218. ---------------------------------
  219. end -- end da função new player
  220. 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>')
  221. tfm.exec.setGameTime(9999999999)
  222. table.foreach(tfm.get.room.playerList, eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement