Advertisement
Flyingwr

[Script] #block

Jul 31st, 2018
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 39.44 KB | None | 0 0
  1. --[[ Disable ]]--
  2. for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'AutoScore'} do
  3.     tfm.exec['disable' .. v]()
  4. end
  5.  
  6. for _, v in next, {'r', 'rank', 'ranking', 'lang', 'langue', 'help', 'ajuda', 'ayuda', 'ban', 'kick', 'unban', 'unkick', 'powerup', 'unrank'} do
  7.     system.disableChatCommandDisplay(v)
  8. end
  9.  
  10. -- [[ Script Data ]]--
  11. local data = {
  12.     -- Table
  13.     staff = {
  14.         -- Admin > !ban/!kick !unban/unkick !unrank
  15.         ['Bolodefchoco#0000'] = 1,
  16.         ['Fly#8215'] = 1,
  17.         ['Rianmojang1#0000'] = 1
  18.     },
  19.     player = {
  20.         list = {},
  21.  
  22.         winner = ''
  23.     },
  24.     block = {
  25.         list = {
  26.             [1] = {
  27.                 isFrozen = false,
  28.  
  29.                 countdown = os.time(),
  30.                 -- Ground properties
  31.                 type = 12,
  32.                 width = 50,
  33.                 height = 50,
  34.                 x = 1000,
  35.                 y = -250
  36.             },
  37.             [2] = {
  38.                 isFrozen = false,
  39.  
  40.                 countdown = os.time(),
  41.                 -- Ground properties
  42.                 type = 12,
  43.                 width = 50,
  44.                 height = 50,
  45.                 x = 1000,
  46.                 y = -250
  47.             }
  48.         },
  49.         increaseTick = {
  50.             [30] = 10,
  51.             [60] = 15,
  52.             [80] = 20,
  53.             [120] = 50,
  54.             [160] = 30,
  55.             [200] = 30,
  56.             [220] = 40
  57.         },
  58.     },
  59.     powerup = {
  60.         traps = {},
  61.  
  62.         currentType = '',
  63.  
  64.         x = 0,
  65.         y = 0
  66.     },
  67.     map = {
  68.         list = {
  69.             '@7465700', '@7473420', '@7483324', '@7484233', '@7482735', '@7483285', '@7483941', '@7483593', '@7470110', '@7470116', '@7261057', '@7470071', '@7470134', '@7471243', '@7472054', '@7473526', '@7472834', '@7472869', '@7478945', '@7482067', '@7474073', '@7483681', '@6595400', '@7482735', '@7483593', '@6986307'
  70.         },
  71.  
  72.         height, width = 800, 400
  73.     },
  74.  
  75.     -- Number
  76.     currentTime = 0,
  77.  
  78.     -- String
  79.     img = '',
  80.  
  81.     -- Boolean
  82.     isTribeHouse = (tfm.get.room.name:find(string.char(3)) and true or false)
  83. }
  84. -- Set a function for each power up in list
  85. data.powerup.list = {
  86.     meep = function(n)
  87.         tfm.exec.giveMeep(n)
  88.     end,
  89.     trap = function(n, x, y)
  90.         local obj = tfm.exec.addShamanObject(68, x, y)
  91.         data.powerup.traps[#data.powerup.traps + 1] = {obj, os.time()}
  92.  
  93.         local target = targetSelect()
  94.         data.player.list[target[1]].target = 1
  95.         tfm.exec.movePlayer(n, x, y)
  96.     end,
  97.     imortal = function(n)
  98.         data.player.list[n].immortality = {true, os.time()}
  99.     end,
  100.     decrease = function()
  101.         data.block.list[1].width, data.block.list[1].height = (data.block.list[1].width - 20), (data.block.list[1].height - 20)
  102.     end,
  103.     explosion = function(n, x, y)
  104.         tfm.exec.explosion(x, y, 200, 60)
  105.         tfm.exec.displayParticle(12, x, y)
  106.     end,
  107.     teleport = function(n)
  108.         tfm.exec.movePlayer(n, math.random(20, (data.map.width - 40)), math.random(20, (data.map.height - 40)))
  109.     end,
  110.     freeze = function()
  111.         local target = targetSelect()
  112.         for i = 1, #target do
  113.             data.block.list[i].isFrozen = true
  114.             data.block.list[i].countdown = os.time()
  115.         end
  116.     end,
  117.     clone = function()
  118.         local w, h = (data.block.list[1].width / 2), (data.block.list[1].height / 2)
  119.         data.block.list[1].width, data.block.list[1].height = w, h
  120.         data.block.list[2].width, data.block.list[2].height = w, h
  121.         data.block.list[2].x, data.block.list[2].y = data.block.list[1].x, data.block.list[1].y
  122.  
  123.         randomPlayer(2)
  124.  
  125.         data.block.list[2].countdown = os.time()
  126.     end,
  127.     time = function()
  128.         tfm.exec.setGameTime((data.currentTime + 30), true)
  129.     end
  130. }
  131.  
  132. local translations = {
  133.     ['br'] = {
  134.         block = "O Bloco aumentou de tamanho! :O",
  135.         help = "<p align='center'><font size='20'><B><J>Ajuda</font></J>\n\n<font size='13'>Seu objetivo neste jogo é bem simples, corra o mais rapido que puder do bloco assasino. Pegue Powerups para te ajudar a sobreviver. Tome cuidado com as armadilhas dentro dos blocos. :P<BR><J>Envie mapas para nós!<BR><VP><a href='event:mapsLink'>atelier801.com/topic?f=819406&t=924082</a>",
  136.         powerups = "<J>Atualmente existem <CE>9</CE> powerups:</J><BR><VP>Immortality -- <N>Imortalidade por 10 segundos<BR><VP>Trap -- <N>Te prende em uma armadilha<BR><VP>Meep -- <N>Te da MEEP<BR><VP>Decrase -- <N>Diminui o bloco em 20x20<BR><VP>Explosion -- <N>O bloco de powerup explode<BR><VP>Teleport -- <N>Te teleporta em algum lugar aleatório do mapa<BR><VP>Freeze -- <N>Congela o bloco por 10 segundos<BR><VP>Clone -- <N>Clona o bloco<BR><VP>Time -- <N>Adiciona 30s na partida",
  137.         help_title = "<font size='16'><p align='center'><a href='event:openhelp'><VP>Ajuda",
  138.         welcome = "<ROSE>Seja bem vindo ao Block<BR><VP>Versão Beta v2.0.<BR><N>Digite <J>!help</CE> para mais informações.<BR><J>Quer ver seu mapa aparecendo? Envie para nós avaliarmos em:<BR><VP>https://atelier801.com/topic?f=819406&t=924082",
  139.         caughtPowerup = "<CE><VP>%s</VP> pegou o PowerUp <VP>%s</VP>",
  140.         targetBlock = "Alvo do bloco: <b><v>",
  141.         targetBlocks = "Alvos: <b><v>",
  142.         credits = "<p align='center'><font size='20'><B><CE>Créditos</font></CE>\n\n<font size='11'><p align='left'><CE>Desenvolvedores</CE>: Rianmojang1#0000 e Fly#8215\n\n<J>Essas outras pessoas ajudaram a testar o jogo, em mapas ou em alguma parte do Script: </J>Bodykudo#0000, Madaryagah#0000,<BR>Contistente#0000, Pro#1435",
  143.         credits_title = "<font size='16'><p align='center'><a href='event:opencredits'><VP>Créditos",
  144.         rankingRoom = "Sala",
  145.         rankingName = "Nome",
  146.         rankingWins = "Vitórias",
  147.         rankingRounds = "Rodadas",
  148.         rankingPosition = "Pos.",
  149.         rankingMessage = "<ROSE>O ranking não é global, os dados atuais são dessa única sala.<BR>Rodadas e vitórias contam a partir de 6 jogadores.",
  150.         noWinner = "Ninguém venceu",
  151.         win = "venceu",
  152.         banMessage = "<p align=\"center\"><font size=\"32\">Você foi banido!\nSerá desbanido em: <CE>%s</CE> segundos.\n Motivo:%s",
  153.         breakRules = "Quebrou as regras"
  154.     },
  155.     ['en'] = {
  156.         block = "The block increased in size! :O",
  157.         help = "<p align='center'><font size='20'><B><J>Help</font></J>\n\n<font size='13'>Your aim in this minigame is simple: run as fast as you can and avoid the murderer ground. Collect powerups that help you survive. Take care with the traps inside the powerup block. :P<BR><J>Send maps!<BR><VP><a href='event:mapsLink'>atelier801.com/topic?f=819406&t=924082</a>",
  158.         powerups = "<J>There are currently <CE>9</CE> powerups:</J><BR><VP>Immortality -- <N>Makes you imortal for 10 seconds<BR><VP>Trap -- <N>Puts you in a trap<BR><VP>Meep -- <N>Gives you MEEP<BR><VP>Decrase -- <N>Decreases the ground to 20x20<BR><VP>Explosion -- <N>The powerup ground explodes<BR><VP>Teleport -- <N>Teleports you to a random location in the map.<BR><VP>Freeze -- <N>Freezes the block for 10 seconds.<BR><VP>Clone -- <N>Clones the block<BR><VP>Time -- <N>Adds 30s in game",
  159.         help_title = "<font size='16'><p align='center'><a href='event:openhelp'><VP>Help",
  160.         welcome = "<ROSE>Welcome to the module Block<BR><VP>Beta Version v2.0.<BR><N>Type <J>!help</CE> to read more about the minigame.<BR><J>Want to see your map here? Send it here: <BR><VP>https://atelier801.com/topic?f=819406&t=924082",
  161.         caughtPowerup = "<CE><VP>%s</VP> got a PowerUp <VP>%s</VP>",
  162.         targetBlock = "Block target: <b><v>",
  163.         targetBlocks = "Targets: <b><v>",
  164.         credits = "<p align='center'><font size='20'><B><CE>Credits</font></CE>\n\n<font size='11'><p align='left'><CE>Developers</CE>: Rianmojang1#0000 and Fly#8215\n\n<J>These people helped testing the module, sending maps or coding the game: </J>Bodykudo#0000, Madaryagah#0000,<BR>Contistente#0000, Pro#1435",
  165.         credits_title = "<font size='16'><p align='center'><a href='event:opencredits'><VP>Credits",
  166.         rankingRoom = "Room",
  167.         rankingName = "Name",
  168.         rankingWins = "Wins",
  169.         rankingRounds = "Rounds",
  170.         rankingPosition = "Pos.",
  171.         rankingMessage = "<ROSE>The ranking isn't global, the current data are from this single room.<BR>Rounds and wins counts from 6 players in the room.",
  172.         noWinner = "No one won",
  173.         win = "won",
  174.         banMessage = "<p align=\"center\"><font size=\"32\">You are banned!\nYou will be able to play in: <CE>%s</CE> seconds. Reason:%s",
  175.         breakRules = "Broken rules"
  176.     },
  177.     ['es'] = {
  178.         block = "El bloque aumentó de tamaño! :O",
  179.         help = "<p align='center'><font size='20'><B><J>Help</font></J>\n\n<font size='13'>Tu objetivo en este minijuego es simple: corre lo más rápido que puedas del bloque asesino. Recolecta potenciadores que te ayudarán a sobrevivir. Ten cuidado con las trampas dentro de los powerups. :P<BR><J>¡Envía mapas para el módulo!<BR><VP><a href='event:mapsLink'>atelier801.com/topic?f=819406&t=924082</a>",
  180.         powerups = "<J>Actualmente existen <CE>9</CE> powerups:</J><BR><VP>Immortality -- <N>Te hace inmortal durante 10 segundos<BR><VP>Trap -- <N>Te coloca sobre una trampa<BR><VP>Meep -- <N>Te otorga el MEEP<BR><VP>Decrase -- <N>Disminuye el suelo a 20x20<BR><VP>Explosión -- <N>La superficie del potenciador explota<BR><VP>Teleport -- <N>Te teletransporta a una ubicación aleatoria en el mapa.<BR><VP>Freeze -- <N>Congela el bloque por 10 segundos<BR><VP>Clone -- <N>Clona el bloque<N><BR><VP>Time -- <N>Agrega 30 segundos en el juego<BR>",
  181.         help_title = "<font size='16'><p align='center'><a href='event:openhelp'><VP>Ayuda",
  182.         welcome = "<ROSE>Bienvenido al módulo Block<BR><VP>Versión Beta v2.0.<BR><N>Escribe <J>!help</CE> para saber más del minijuego.<BR><J>¿Quieres ver tu mapa en el módulo? Envíalo aquí: <BR><VP>https://atelier801.com/topic?f=819406&t=924082",
  183.         caughtPowerup = "<CE> <VP>%s </VP> obtuvieron un PowerUp <VP>%s</VP>",
  184.         targetBlock = "Objetivo del bloque: <b><v>",
  185.         targetBlocks = "Objetivos: <b><v>",
  186.         credits = "<p align='center'><font size='20'><B><CE>Créditos</font></CE>\n\n<font size='11'><p align='left'><CE>Desarrolladores</CE>: Rianmojang1#0000 e Fly#8215\n\n<J>Estas personas han ayudado probando el módulo, enviando mapas o con códigos: </J>Bodykudo#0000, Madaryagah#0000,<BR>Contistente#0000, Pro#1435",
  187.         credits_title = "<font size='16'><p align='center'><a href='event:opencredits'><VP>Créditos",
  188.         rankingRoom = "Sala",
  189.         rankingName = "Nombre",
  190.         rankingWins = "Victorias",
  191.         rankingRounds = "Rodadas",
  192.         rankingPosition = "Pos.",
  193.         rankingMessage = "<ROSE>El ranking no es global, los datos actuales provienen de esta única sala.<BR>Las rondas y victorias cuentan a partir de 6 jugadores en la sala.",
  194.         noWinner = "Nadie ganó",
  195.         win = "ganó",
  196.         banMessage = "<p align=\"center\"><font size=\"32\">Estás prohibido de jugar!\nSe le permitirá jugar en: <CE>%s</CE> segundos. Razón:%s",
  197.         breakRules = "Reglas rotas"
  198.     },
  199.     ['fr'] = {
  200.         block = "Le bloc a augnenté en taille! :O",
  201.         help = "<p align='center'><font size='20'><B><J>Aide</font></J>\n\n<font size='13'>Votre but dans ce mini-jeu est simple: courez ausse vite que vous pouzes et éviter le bloc. Rassemblez les powerups qui vous aide à survivre.<BR><J>Envoyez des cartes au module!<BR><VP><a href='event:mapsLink'>atelier801.com/topic?f=819406&t=924082</a>",
  202.         powerups = "<J>Il y a actuellement <CE>9</CE> powerups:</J><BR><VP>Immortality -- <N>Vous devenez immortel pendant 10 secondes<BR><VP>Trap -- <N>Vous met dans un piège<BR><VP>Meep -- <N>Vous donne le MEEP<BR><VP>Decrase -- <N>Diminue le bloc à 20x20<BR><VP>Explosion -- <N>Eclate le powerup du bloc<BR><VP>Teleport -- <N>Vous téléporte à un emplacement aléatoire dans la carte<BR><VP>Freeze -- <N>Gèle le bloc pendant 10 secondes<BR><VP>Clone -- <N>Clone le bloc<BR><VP>Time -- <N>Ajoute 30 secondes dans le jeu",
  203.         help_title = "<font size='16'><p align='center'><a href='event:openhelp'><VP>Aide",
  204.         welcome = "<ROSE>Bienvenue sur le module #Block!<BR><N>Tapez <J>!help</CE> pour plus en savoir sur le mini-jeu.<BR><J>Vous voulez voir votre carte ici? Envoyes ici:<BR><VP>https://atelier801.com/topic?f=819406&t=924082",
  205.         caughtPowerup = "<CE><VP>%s</VP> a obtenu le powerup <VP>%s</VP>",
  206.         targetBlock = "Cible du bloc: <b><v>",
  207.         targetBlocks = "Ciles: <b><v>",
  208.         credits = "<p align='center'><font size='20'><B><CE>Crédits</font></CE>\n\n<font size='11'><p align='left'><CE>Développeurs</CE>: Rianmojang1#0000 & Fly#8215\n\n<J>Ces personnes ont aidé à tester le module, à envoyer des cartes ou à coder certaines choses: </J>Bodykudo#0000, Madaryagah#0000,<BR>Contistente#0000, Pro#1435",
  209.         credits_title = "<font size='16'><p align='center'><a href='event:opencredits'><VP>Crédits",
  210.         rankingRoom = "Salon",
  211.         rankingName = "Pseudo",
  212.         rankingWins = "Victoires",
  213.         rankingRounds = "Tour",
  214.         rankingPosition = "Pos.",
  215.         rankingMessage = "<ROSE>Le classement n'est pas mondial, les données actuelles sont seulement de ce salon.<BR>Les tours et les victoires comptent à 6 joueurs dans le salon.",
  216.         noWinner = "Personne n'a gagné",
  217.         win = "gagné",
  218.         banMessage = "<p align=\"center\"><font size=\"32\">You are banned!\nVous êtes banni! Vous pourrez rejouer danz: <CE>%s</CE> secondes. Raison:%s",
  219.         breakRules = "Enfreint les règles"
  220.     }
  221. }
  222. translations['pt'] = translations['br']
  223.  
  224. -- [[ Function Lib ]] --
  225. function distance(x1, y1, x2, y2, range)
  226.     local dx = (x1 - x2)
  227.     local dy = (y1 - y2)
  228.     return math.sqrt(dx * dx + dy * dy) <= range
  229. end
  230.  
  231. function split(t,s)
  232.     local a = {}
  233.     for k, v in string.gmatch(t, string.format("[^%s]+", s or "%s")) do
  234.         table.insert(a, k)
  235.     end
  236.  
  237.     return a
  238. end
  239.  
  240. function targetSelect()
  241.     local t = {}
  242.     for k, v in next, data.player.list do
  243.         if (v.target ~= 0) then
  244.             t[#t + 1] = k
  245.         end
  246.     end
  247.  
  248.     return t
  249. end
  250.  
  251. function translate(name, key)
  252.     local lang = (data.player.list[name] and data.player.list[name].lang or tfm.get.room.community)
  253.     lang = (translations[lang] and lang or 'en')
  254.     return translations[lang][key] or nil
  255. end
  256.  
  257. function banWarning(name)
  258.     if (data.player.list[name].ban) then
  259.         if (data.player.list[name].banTime > 0) then
  260.             ui.addTextArea(999, '', name, 5, 0, 800, 400, 0x000000, 0x000001, 1, true)
  261.             ui.addTextArea(1000, string.format(translate(name, 'banMessage'), math.ceil(data.player.list[name].banTime), data.player.list[name].banReason), name, 100, 138, 586, nil, 0x324650, 0x000000, 0, true)
  262.         else
  263.             data.player.list[name].ban = false
  264.             data.player.list[name].banReason = ''
  265.                
  266.             ui.removeTextArea(999, name); ui.removeTextArea(1000, name)
  267.         end
  268.     else
  269.         ui.removeTextArea(999, name); ui.removeTextArea(1000, name)
  270.     end
  271. end
  272.  
  273. function showTarget(name)
  274.     local t = targetSelect()
  275.  
  276.     if (#t > 0) then
  277.         local key = (#t > 1 and 'targetBlocks' or 'targetBlock')
  278.         local str = (key == 'targetBlock' and t[1] or t[1] .. ' & ' .. t[2])
  279.         ui.addTextArea(100, "<p align='center'><font size='12'>" .. translate(name, key) .. str, name, 5, 25, nil, 21, 0x0e3142, 0x000001, .9, true)
  280.     end
  281. end
  282.  
  283. function randomPlayer(key)
  284.     local list = {}
  285.     for k, v in next, data.player.list do
  286.         if (tfm.get.room.playerList[k] and not tfm.get.room.playerList[k].isDead) then
  287.             if (v.target == 0) then
  288.                 list[#list + 1] = k
  289.             elseif (v.target == key) then
  290.                 v.target = 0
  291.             end
  292.         end
  293.     end
  294.  
  295.     local p = list[math.random(#list)] -- Selected player
  296.     if (p) then
  297.         data.player.list[p].target = key
  298.     end
  299.  
  300.     table.foreach(tfm.get.room.playerList, showTarget)
  301. end
  302.  
  303. function showRanking(name)
  304.     data.player.list[name].openrank = true
  305.  
  306.     local t = {'', '', '', '', {}}
  307.     local pos = 1
  308.  
  309.     local room = tfm.get.room.name
  310.    
  311.     for k, v in next, data.player.list do
  312.         if (v.wins > 0) then
  313.             t[5][#t[5] + 1] = {k, v.wins, v.rounds}
  314.         end
  315.     end
  316.  
  317.     table.sort(t[5], function(a, b) return a[2] > b[2] end)
  318.    
  319.     if (pos < 10) then
  320.         for i = 1, #t[5] do
  321.             local nick = t[5][i][1]
  322.             local tag = nick:sub(nick:find('#'), #nick)
  323.             local wins = t[5][i][2]
  324.             local rounds = t[5][i][3]
  325.  
  326.             t[1] = t[1] .. '#' .. pos .. '\n'
  327.             t[2] = t[2] .. nick:sub(1, nick:find('#') - 1) .. "<font size='9'><g>" .. tag .. '</g></font>\n'
  328.             t[3] = t[3] .. wins .. '\n'
  329.             t[4] = t[4] .. rounds .. '\n'
  330.  
  331.             pos = (pos + 1)
  332.         end
  333.     end
  334.  
  335.     ui.addTextArea(50, "", name, 191, 53, 441, 282, 0x183442, 0x183442, 1, true)
  336.     ui.addTextArea(51, "", name, 458, 153, 59, 166, 0x7d8d99, 0x000000, 1, true)
  337.     ui.addTextArea(52, "", name, 290, 153, 129, 166, 0x7d8d99, 0x050505, 1, true)
  338.     ui.addTextArea(53, "", name, 292, 155, 129, 166, 0x7d8d99, 0x7d8d99, 1, true)
  339.     ui.addTextArea(54, "", name, 460, 155, 59, 166, 0x7d8d99, 0x7d8d99, 1, true)
  340.     ui.addTextArea(55, "", name, 458, 153, 59, 166, 0x7d8d99, 0x000000, 1, true)
  341.     ui.addTextArea(56, "", name, 550, 154, 59, 166, 0x7d8d99, 0x000000, 1, true)
  342.     ui.addTextArea(57, "<p align='center'><font size='16'>" .. translate(name, 'rankingPosition'), name, 203, 123, 56, 30, 0x324650, 0x000000, 0, true) -- Position
  343.     ui.addTextArea(58, "<p align='center'><font size='16'>" .. translate(name, 'rankingName'), name, 292, 123, 129, 30, 0x324650, 0x000000, 0, true) -- Name
  344.     ui.addTextArea(59, "<p align='center'><font size='16'>" .. translate(name, 'rankingWins'), name, 447, 123, 80, 30, 0x324650, 0x000000, 0, true) -- Wins
  345.     ui.addTextArea(60, "<p align='center'><font size='16'>" .. translate(name, 'rankingRounds'), name, 541, 123, 80, 30, 0x324650, 0x000000, 0, true) -- Rounds
  346.     ui.addTextArea(61, "", name, 211, 155, 44, 166, 0x7d8d99, 0x7d8d99, 1, true)
  347.     ui.addTextArea(62, "", name, 209, 153, 44, 166, 0x0b1d26, 0x000000, 1, true)
  348.     ui.addTextArea(63, "", name, 552, 155, 59, 166, 0x7d8d99, 0x7d8d99, 1, true)
  349.     ui.addTextArea(64, "", name, 550, 153, 59, 166, 0x7d8d99, 0x000000, 1, true)
  350.     ui.addTextArea(65, "<p align='center'><font size='40'>Ranking", name, 312, 50, 194, nil, 0x324650, 0x000000, 0, true)
  351.     ui.addTextArea(66, "<p align='center'><font size='12'>" .. translate(name, 'rankingRoom') .. " : " .. room, name, 191, 102, 441, nil, 0x183442, 0x183442, 0, true) -- Room
  352.     ui.addTextArea(67, "<p align='center'><font size='13'>" .. t[4], name, 551, 154, 59, 166, 0x0b1d26, 0x0b1d26, 1, true)
  353.     ui.addTextArea(68, "<p align='center'><font size='13'>" .. t[3], name, 459, 154, 59, 166, 0x0b1d26, 0x0b1d26, 1, true)
  354.     ui.addTextArea(69, "<p align='center'><font size='13'>" .. t[1], name, 210, 154, 44, 166, 0x0b1d26, 0x0b1d26, 1, true)
  355.     ui.addTextArea(70, "<p align='center'><font size='13'>" .. t[2], name, 291, 154, 129, 166, 0x0b1d26, 0x0b1d26, 1, true)
  356.     ui.addTextArea(71, "<font size='20'><R><a href='event:closerank'>✖", name, 607, 50, 32, 43, 0x324650, 0x000000, 0, true)
  357.    
  358.     tfm.exec.chatMessage(translate(name, 'rankingMessage'), name)
  359. end
  360.  
  361. function showHelp(name)
  362.     data.player.list[name].openhelp = true
  363.    
  364.     ui.addTextArea(0, "", name, 5, 24, 791, 385, 0x000001, 0x000000, 0.7, true)
  365.     ui.addTextArea(1, "", name, 438, 127, 106, 25, 0x052636, 0x000000, 1, true)
  366.     ui.addTextArea(2, "", name, 171, 116, 454, 217, 0x0a1d26, 0x7d8d99, 1, true)
  367.     ui.addTextArea(3, "", name, 175, 119, 454, 217, 0x0a1d26, 0x000000, 1, true)
  368.     ui.addTextArea(4, "", name, 172, 117, 454, 217, 0x0a1d26, 0x0a1d26, 1, true)
  369.     ui.addTextArea(5, "", name, 341, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  370.     ui.addTextArea(6, "", name, 481, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  371.     ui.addTextArea(7, "", name, 201, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  372.     ui.addTextArea(8, "", name, 203, 125, 106, 26, 0x052636, 0x000000, 1, true)
  373.     ui.addTextArea(9, "", name, 343, 127, 106, 25, 0x052636, 0x000000, 1, true)
  374.     ui.addTextArea(10, "", name, 484, 126, 106, 25, 0x052636, 0x000000, 1, true)
  375.     ui.addTextArea(11, "<font size='16'><p align='center'><a href='event:openpowerups'><VP>Powerups", name, 482, 124, 106, 25, 0x052636, 0x052636, 1, true)
  376.     ui.addTextArea(12, translate(name, 'help_title'), name, 202, 124, 106, 25, 0x052636, 0x052636, 1, true)
  377.     ui.addTextArea(13, translate(name, 'credits_title'), name, 342, 124, 106, 25, 0x052636, 0x052636, 1, true)
  378.     ui.addTextArea(14, translate(name, 'help'), name, 182, 169, 438, 160, 0x0a2c3d, 0x0a2c3d, 1, true)
  379.     ui.addTextArea(15, "<font size='20'><R><a href='event:closehelp'>X", name, 608, 118, 28, 34, 0x324650, 0x000000, 0, true)
  380. end
  381.  
  382. function showCredits(name)
  383.     data.player.list[name].openhelp = true
  384.    
  385.     ui.addTextArea(0, "", name, 5, 24, 791, 385, 0x000001, 0x000000, 0.7, true)
  386.     ui.addTextArea(1, "", name, 438, 127, 106, 25, 0x052636, 0x000000, 1, true)
  387.     ui.addTextArea(2, "", name, 171, 116, 454, 217, 0x0a1d26, 0x7d8d99, 1, true)
  388.     ui.addTextArea(3, "", name, 175, 119, 454, 217, 0x0a1d26, 0x000000, 1, true)
  389.     ui.addTextArea(4, "", name, 172, 117, 454, 217, 0x0a1d26, 0x0a1d26, 1, true)
  390.     ui.addTextArea(5, "", name, 341, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  391.     ui.addTextArea(6, "", name, 481, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  392.     ui.addTextArea(7, "", name, 201, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  393.     ui.addTextArea(8, "", name, 203, 125, 106, 26, 0x052636, 0x000000, 1, true)
  394.     ui.addTextArea(9, "", name, 343, 127, 106, 25, 0x052636, 0x000000, 1, true)
  395.     ui.addTextArea(10, "", name, 484, 126, 106, 25, 0x052636, 0x000000, 1, true)
  396.     ui.addTextArea(11, "<font size='16'><p align='center'><a href='event:openpowerups'><VP>Powerups", name, 482, 124, 106, 25, 0x052636, 0x052636, 1, true)
  397.     ui.addTextArea(12, translate(name, 'help_title'), name, 202, 124, 106, 25, 0x052636, 0x052636, 1, true)
  398.     ui.addTextArea(13, translate(name, 'credits_title'), name, 342, 124, 106, 25, 0x052636, 0x052636, 1, true)
  399.     ui.addTextArea(14, translate(name, 'credits'), name, 182, 169, 438, 160, 0x0a2c3d, 0x0a2c3d, 1, true)
  400.     ui.addTextArea(15, "<font size='20'><R><a href='event:closehelp'>X", name, 608, 118, 28, 34, 0x324650, 0x000000, 0, true)
  401. end
  402.  
  403. function showPowerups(name)
  404.     data.player.list[name].openhelp = true
  405.  
  406.     ui.addTextArea(0, "", name, 5, 24, 791, 385, 0x000001, 0x000000, 0.7, true)
  407.     ui.addTextArea(1, "", name, 438, 127, 106, 25, 0x052636, 0x000000, 1, true)
  408.     ui.addTextArea(2, "", name, 171, 116, 454, 217, 0x0a1d26, 0x7d8d99, 1, true)
  409.     ui.addTextArea(3, "", name, 175, 119, 454, 217, 0x0a1d26, 0x000000, 1, true)
  410.     ui.addTextArea(4, "", name, 172, 117, 454, 217, 0x0a1d26, 0x0a1d26, 1, true)
  411.     ui.addTextArea(5, "", name, 341, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  412.     ui.addTextArea(6, "", name, 481, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  413.     ui.addTextArea(7, "", name, 201, 123, 106, 25, 0x052636, 0x7d8d99, 1, true)
  414.     ui.addTextArea(8, "", name, 203, 125, 106, 26, 0x052636, 0x000000, 1, true)
  415.     ui.addTextArea(9, "", name, 343, 127, 106, 25, 0x052636, 0x000000, 1, true)
  416.     ui.addTextArea(10, "", name, 484, 126, 106, 25, 0x052636, 0x000000, 1, true)
  417.     ui.addTextArea(11, "<font size='16'><p align='center'><a href='event:openpowerups'><VP>Powerups", name, 482, 124, 106, 25, 0x052636, 0x052636, 1, true)
  418.     ui.addTextArea(12, translate(name, 'help_title'), name, 202, 124, 106, 25, 0x052636, 0x052636, 1, true)
  419.     ui.addTextArea(13, translate(name, 'credits_title'), name, 342, 124, 106, 25, 0x052636, 0x052636, 1, true)
  420.     ui.addTextArea(14, translate(name, 'powerups'), name, 182, 169, 438, 160, 0x0a2c3d, 0x0a2c3d, 1, true)
  421.     ui.addTextArea(15, "<font size='20'><R><a href='event:closehelp'>X", name, 608, 118, 28, 34, 0x324650, 0x000000, 0, true)
  422. end
  423.  
  424. function newMap(map)
  425.     local code = (map or '')
  426.     if (code ~= '') then
  427.         tfm.exec.newGame(map)
  428.     else
  429.         repeat
  430.             code = data.map.list[math.random(#data.map.list)]
  431.         until
  432.             code ~= tfm.get.room.currentMap
  433.     end
  434.  
  435.     data.block.list[1].x, data.block.list[1].y = 1000, -250
  436.     data.block.list[1].width, data.block.list[1].height = 50, 50
  437.  
  438.     for k, v in next, data.player.list do
  439.         if (v.target ~= 0) then
  440.             v.target = 0
  441.         end
  442.     end
  443.  
  444.     if (code ~= '') then
  445.         tfm.exec.newGame(code)
  446.     end
  447. end
  448. newMap()
  449.  
  450. function randomColor()
  451.     return math.random(0xFFFFFF)
  452. end
  453.  
  454. function setPowerup(type)
  455.     local i
  456.  
  457.     local list = {}
  458.     for k, v in next, data.powerup.list do
  459.         list[#list + 1] = k
  460.     end
  461.  
  462.     local chance = 160
  463.     local chance = math.random(chance)
  464.     if (chance <= 20) then -- Meep -> 20% chance
  465.         i = 1
  466.     elseif (chance <= 40) then -- Imortal -> 20% chance
  467.         i = 2
  468.     elseif (chance <= 60) then -- Clone -> 20% chance
  469.         i = 3
  470.     elseif (chance <= 80) then -- Decrease -> 20% chance
  471.         i = 4
  472.     elseif (chance <= 100) then -- Explosion -> 20% chance
  473.         i = 5
  474.     elseif (chance <= 115) then -- Teleport -> 15% chance
  475.         i = 6
  476.     elseif (chance <= 130) then -- Freeze -> 15% chance
  477.         i = 7
  478.     elseif (chance <= 145) then -- Clone -> 15% chance
  479.         i = 8
  480.     elseif (chance <= 160) then -- Time -> 15% chance
  481.         i = 9
  482.     end
  483.  
  484.     if (type) then
  485.         i = (list[tonumber(type)] and tonumber(type) or i)
  486.     end
  487.  
  488.     data.powerup.currentType = list[i]
  489.  
  490.     local x, y = data.map.width, data.map.height
  491.     data.powerup.x = (math.random(0, x))
  492.     data.powerup.y = (math.random(0, y))
  493.  
  494.     if (data.img ~= '') then
  495.         tfm.exec.removeImage(data.img)
  496.         data.img = ''
  497.     end
  498.     data.img = tfm.exec.addImage("164a5bd1079.png","!999", tonumber(data.powerup.x), tonumber(data.powerup.y))
  499.     --ui.addTextArea(201, "<p align='center'><font size='20' color='#FFFFFF' face='Impact'>", nil, data.powerup.x, data.powerup.y, 30, 30, 0xFFD700, 0xFFD700, 1, false)
  500. end
  501.  
  502. function update()
  503.     local target = targetSelect()
  504.     local p = #target
  505.  
  506.     for i = 1, #target do
  507.         local x, y = tfm.get.room.playerList[target[i]] and tfm.get.room.playerList[target[i]].x or nil, tfm.get.room.playerList[target[i]] and tfm.get.room.playerList[target[i]].y or nil
  508.  
  509.         if (x and y) then
  510.             if (not data.block.list[i].isFrozen) then
  511.                 if (x > data.block.list[i].x) then
  512.                     data.block.list[i].x = (data.block.list[i].x + 30)
  513.                 else
  514.                     data.block.list[i].x = (data.block.list[i].x - 30)
  515.                 end
  516.  
  517.                 if (y > data.block.list[i].y) then
  518.                     data.block.list[i].y = (data.block.list[i].y + 30)
  519.                 else
  520.                     data.block.list[i].y = (data.block.list[i].y - 30)
  521.                 end
  522.             else
  523.                 data.block.list[i].type = 1
  524.             end
  525.  
  526.             if (data.block.list[i].countdown < os.time() - 10000) then
  527.                 for k, v in next, data.player.list do
  528.                     if (v.target == i) then
  529.                         v.target = 0
  530.  
  531.                         p = (p - 1)
  532.                     end
  533.                 end
  534.  
  535.                 if (i ~= 2) then
  536.                     randomPlayer(i)
  537.                 else
  538.                     data.block.list[i].x, data.block.list[i].y = 1000, -250
  539.  
  540.                     tfm.exec.removePhysicObject(i)
  541.  
  542.                     table.foreach(tfm.get.room.playerList, showTarget)
  543.                 end
  544.  
  545.                 data.block.list[i].countdown = os.time()
  546.                 data.block.list[i].isFrozen = false
  547.                 data.block.list[i].type = 12
  548.             end
  549.         else
  550.             randomPlayer(i)
  551.         end
  552.     end
  553.  
  554.     for i = 1, p do
  555.         tfm.exec.addPhysicObject(i, data.block.list[i].x, data.block.list[i].y, {
  556.             type = data.block.list[i].type,
  557.             width = data.block.list[i].width,
  558.             height = data.block.list[i].height,
  559.             color = randomColor()
  560.         })
  561.     end
  562. end
  563.  
  564. -- [[ TFM Api ]] --
  565. function eventNewPlayer(name)
  566.     tfm.exec.lowerSyncDelay(name)
  567.    
  568.     if (not data.player.list[name]) then
  569.         data.player.list[name] = {
  570.             rounds = 0,
  571.             wins = 0,
  572.             ban = false,
  573.             banTime = 0,
  574.             banReason = '',
  575.             hide = false,
  576.             openrank = false,
  577.             openhelp = false,
  578.             target = 0,
  579.             immortality = {false, os.time()},
  580.             lang = tfm.get.room.playerList[name].community
  581.         }
  582.     end
  583.  
  584.     local keys = {0, 2, 32, 72, 76} -- Left Key, Right Key, Spacebar, H, L
  585.     for k, v in next, keys do
  586.         system.bindKeyboard(name, v, true)
  587.     end
  588.  
  589.     tfm.exec.chatMessage(translate(name, 'welcome'), name)
  590. end
  591. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  592.  
  593. function eventChatCommand(name, cmd)    
  594.     local arg = split(cmd, " ")
  595.  
  596.     local perm = (data.staff[name] or 666)
  597.    
  598.     -- [[ Public ]] --
  599.     if (arg[1] == "help" or arg[1] == "ajuda" or arg[1] == "como" or arg[1] == "ayuda") then
  600.         showHelp(name)
  601.     elseif (arg[1] == "creditos" or arg[1] == "Creditos" or arg[1] == "Credits" or arg[1] == "credits") then
  602.         showCredits(name)
  603.     elseif (arg[1] == "rank" or arg[1] == "r" or arg[1] == 'ranking') then
  604.         showRanking(name)
  605.     elseif (arg[1] == 'lang' or arg[1] == 'langue' or arg[1] == 'lingua') then
  606.         if (arg[2]) then    
  607.             arg[2] = arg[2]:lower()
  608.             data.player.list[name].lang = (translations[arg[2]] and arg[2] or data.player.list[name].lang)
  609.         end
  610.  
  611.     -- [[ Priv8 ]] --
  612.     elseif (arg[1] == 'np' or arg[1] == 'map' or arg[1] == 'mapa') then
  613.         if (perm <= 2) then
  614.             if (arg[2]) then
  615.                 newMap(arg[2])
  616.             else
  617.                 newMap()
  618.             end
  619.         end
  620.     elseif (arg[1] == 'ban' or arg[1] == 'kick') then
  621.         if (perm == 1) then
  622.             local player
  623.  
  624.             if (arg[2]) then
  625.                 player = arg[2]:lower():gsub('%a', string.upper, 1)
  626.                 if (data.player.list[player] and not data.staff[player]) then
  627.                     data.player.list[player].banTime = 0
  628.  
  629.                     if (arg[3]) then
  630.                         local t = tonumber(arg[3])
  631.                         t = (t > 0 and t or 60*5)
  632.                         data.player.list[player].banTime = t
  633.                     else
  634.                         data.player.list[player].banTime = (60*5)
  635.                     end
  636.            
  637.                     if (arg[4]) then
  638.                         for i = 4, #arg do
  639.                             data.player.list[player].banReason = data.player.list[player].banReason .. arg[i] .. (i ~= #arg and ' ' or '')
  640.                         end
  641.                     else
  642.                         data.player.list[player].banReason = translate(player, 'breakRules')
  643.                     end
  644.            
  645.                     data.player.list[player].ban = true
  646.                                            
  647.                     banWarning(player)
  648.                     tfm.exec.killPlayer(player)
  649.                 end
  650.             end
  651.         end
  652.     elseif (arg[1] == 'unban' or arg[1] == 'unkick') then
  653.         if (perm == 1) then
  654.             local player
  655.        
  656.             if (arg[2]) then
  657.                 player = arg[2]:lower():gsub('%a', string.upper, 1)
  658.                 if (data.player.list[player]) then
  659.                     data.player.list[player].ban = false
  660.                     data.player.list[player].banTime = 0
  661.                     data.player.list[player].banReason = ''
  662.                     banWarning(player)
  663.                 end
  664.             end
  665.         end
  666.     elseif (arg[1] == 'unrank') then
  667.         if (perm == 1) then
  668.             local player
  669.             if (arg[2]) then
  670.                 player = arg[2]:lower():gsub('%a', string.upper, 1)
  671.                 if (data.player.list[player]) then
  672.                     data.player.list[player].rounds = 1
  673.                     data.player.list[player].wins = 0
  674.                 end
  675.             end
  676.         end
  677.     elseif (data.isTribeHouse and arg[1] == 'powerup') then
  678.         if (perm == 1) then
  679.             if (arg[2]) then
  680.                 setPowerup(arg[2])
  681.             else
  682.                 setPowerup()
  683.             end
  684.         end
  685.     end
  686. end
  687.  
  688. function eventKeyboard(name, key, down, x, y)
  689.     if (key == 32) then
  690.         if (not tfm.get.room.playerList[name].isDead) then
  691.             local distx = math.abs(x - data.powerup.x)
  692.             local disty = math.abs(y - data.powerup.y)
  693.             if (distx <= 35 and disty <= 35 and data.powerup.currentType ~= '') then
  694.                 data.powerup.list[data.powerup.currentType](name, x, y)
  695.  
  696.                 table.foreach(tfm.get.room.playerList, function(k)
  697.                     tfm.exec.chatMessage(string.format(translate(k, 'caughtPowerup'), name, data.powerup.currentType), k)
  698.                 end)
  699.  
  700.                 data.powerup.currentType = ''
  701.                 ui.removeTextArea(201, nil)
  702.  
  703.                 if (data.img ~= '') then
  704.                     tfm.exec.removeImage(data.img)
  705.                     data.img = ''
  706.                 end
  707.             end
  708.         end
  709.     elseif (key == 72) then
  710.         if (not data.player.list[name].openhelp) then
  711.             showHelp(name)
  712.         else
  713.             eventTextAreaCallback(nil, name, 'closehelp')
  714.         end
  715.     elseif (key == 76) then
  716.         if (not data.player.list[name].openrank) then
  717.             showRanking(name)
  718.         else
  719.             eventTextAreaCallback(nil, name, 'closerank')
  720.         end
  721.     end
  722. end
  723.  
  724. function eventTextAreaCallback(id, name, link)
  725.     if (link == 'openhelp') then
  726.         showHelp(name)
  727.     elseif (link == 'opencredits') then
  728.         showCredits(name)
  729.     elseif (link == 'openpowerups') then
  730.         showPowerups(name)
  731.     elseif link == 'closehelp' then
  732.         data.player.list[name].openhelp = false
  733.  
  734.         for id = 0, 15 do
  735.             ui.removeTextArea(id,name)
  736.         end
  737.     elseif (link == 'closerank') then
  738.         data.player.list[name].openrank = false
  739.  
  740.         for id = 50, 71 do
  741.             ui.removeTextArea(id, name)
  742.         end
  743.     elseif (link == 'mapsLink') then
  744.         tfm.exec.chatMessage('<vp>https://atelier801.com/topic?f=819406&t=924082</vp>', name)
  745.     end
  746. end
  747.  
  748. function eventNewGame()
  749.     data.powerup.traps = {}
  750.  
  751.     for _, id in next, {201, 100, 101, 102} do
  752.         ui.removeTextArea(id, nil)
  753.     end
  754.  
  755.     local xml = (tfm.get.room.xmlMapInfo and tfm.get.room.xmlMapInfo.xml)
  756.     if (xml) then
  757.         local mapProp = string.match(xml, "<C><P(.-)/>")
  758.         local w, h = string.match(mapProp, 'L="(%d+)"'), string.match(mapProp, 'H="(%d+)"')
  759.  
  760.         data.map.width, data.map.height = (w and tonumber(w) or 800), (h and tonumber(h) or 400)
  761.     end
  762.  
  763.     randomPlayer(1)
  764.  
  765.     local p = 0
  766.     for k, v in next, tfm.get.room.playerList do
  767.         p = (p + 1)
  768.  
  769.         if (data.player.list[k].ban) then
  770.             tfm.exec.killPlayer(k)
  771.         end
  772.     end
  773.     if (p >= 6) then
  774.         for k, v in next, data.player.list do
  775.             if (tfm.get.room.playerList[k]) then
  776.                 v.rounds = (v.rounds + 1)
  777.             end
  778.         end
  779.     end
  780.  
  781.     tfm.exec.setGameTime(240)
  782. end
  783.  
  784. function eventLoop(t, r)
  785.     local t, r = (t/1000), (r/1000)
  786.     data.currentTime = r
  787.  
  788.     for k, v in next, data.block.increaseTick do
  789.         if (t >= k and t <= (k + .5)) then
  790.             local w, h = (data.block.list[1].width + v), (data.block.list[1].height + v)
  791.             data.block.list[1].width, data.block.list[1].height = w, h
  792.  
  793.             table.foreach(tfm.get.room.playerList, function(k)
  794.                 tfm.exec.chatMessage(translate(k, 'block'), k)
  795.             end)
  796.         end
  797.     end
  798.        
  799.     if (#data.powerup.traps > 0) then
  800.         for i = #data.powerup.traps, 1, -1 do
  801.             local id = data.powerup.traps[i][1]
  802.             local time = data.powerup.traps[i][2]
  803.             if (time < os.time() - 10000) then
  804.                 tfm.exec.removeObject(id)
  805.  
  806.                 table.remove(data.powerup.traps, i)
  807.             end
  808.         end
  809.     end
  810.  
  811.     local target = targetSelect()
  812.     if (#target >= 1) then
  813.         update()
  814.     end
  815.  
  816.     for k, v in next,tfm.get.room.playerList do
  817.         if (data.player.list[k].ban) then
  818.             banWarning(k)
  819.         end
  820.  
  821.         for i = 1, #target do
  822.             local blockx, blocky = data.block.list[i].x, data.block.list[i].y
  823.             local blockw = data.block.list[i].width*.5
  824.  
  825.             if (not v.isDead and distance(v.x, v.y, blockx, blocky, blockw+10)) then
  826.                 if (not data.player.list[k].immortality[1]) then
  827.                     tfm.exec.killPlayer(k)
  828.                 elseif (data.player.list[k].immortality[1] and data.player.list[k].immortality[2] <= (os.time() - 10000)) then
  829.                     data.player.list[k].immortality[1] = false
  830.                     tfm.exec.killPlayer(k)
  831.                 end
  832.             end
  833.         end
  834.     end
  835.  
  836.     for k, v in next, data.player.list do
  837.         if (v.ban) then
  838.             v.banTime = (v.banTime - .5)
  839.         end
  840.     end
  841.  
  842.     if (r < 1) then
  843.         newMap()
  844.     end
  845. end
  846.  
  847. function eventPlayerWon(name)
  848.     tfm.exec.setGameTime(5, false)
  849.  
  850.     winner = name
  851.  
  852.     time2 = 666
  853.  
  854.     for k, v in next, tfm.get.room.playerList do
  855.         ui.addTextArea(100, string.format("<p align='center'><font size='35' color='#00000'>%s %s!", name, translate(k, 'win')), k, 5, 170, 800, nil, nil, nil, 0, true)
  856.         ui.addTextArea(101, string.format("<p align='center'><font size='35'>%s %s!", name, translate(k, 'win')), k, 8, 170, 800, nil, nil, nil, 0, true)
  857.     end
  858.  
  859.     local p = 0
  860.     for k, v in next, tfm.get.room.playerList do
  861.         p = (p + 1)
  862.     end
  863.     if (p >= 6) then
  864.         data.player.list[name].wins = (data.player.list[name].wins + 1)
  865.     end
  866. end
  867.  
  868. function eventPlayerDied(name)
  869.     local players = {}
  870.     local a = 0
  871.     for k, v in next, tfm.get.room.playerList do
  872.         if (not v.isDead) then
  873.             a = (a + 1)
  874.  
  875.             players[a] = k
  876.         end
  877.     end
  878.  
  879.     if (a == 0) then
  880.         table.foreach(tfm.get.room.playerList, function(k)
  881.             ui.addTextArea(100, string.format("<p align='center'><font size='35' color='#00000'>%s!", translate(k, 'noWinner')), k, 5, 170, 800, nil, nil, nil, 0, true)
  882.             ui.addTextArea(101, string.format("<p align='center'><font size='35'>%s!", translate(k, 'noWinner')), k, 8, 170, 800, nil, nil, nil, 0, true)
  883.         end)
  884.  
  885.         tfm.exec.setGameTime(5, false)
  886.     elseif (a == 1) then
  887.         tfm.exec.giveCheese(players[1])
  888.         tfm.exec.playerVictory(players[1])
  889.     elseif (a == 20 or a == 15 or a == 10 or a == 5 or a == 2) then
  890.         setPowerup()
  891.     end
  892.  
  893.     if (data.player.list[name].target ~= 0) then
  894.         local target = data.player.list[name].target
  895.  
  896.         data.player.list[name].target = 0
  897.  
  898.         if (a > 1) then
  899.             randomPlayer(target)
  900.         end
  901.     end
  902. end
  903.  
  904. function eventPlayerLeft(name)
  905.     eventPlayerDied(name)
  906.  
  907.     data.player.list[name].openhelp, data.player.list[name].openrank = false, false
  908. end
  909.  
  910. tfm.exec.setRoomMaxPlayers(25)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement