Advertisement
Rawoas13

I dont know for name

Jun 2nd, 2020
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.70 KB | None | 0 0
  1. mapList = {"6771291","332894","240780","236164","1781408","167618","390595","333425","309234","334193","249633","333051","559413","265093","212420","233520","7027330","278790","202115","272585","241802","173952","162561","254391","263899","247820","137024","260343","179642","233426","336994","162338","273832","279772","2163","266464","211663","196520","145762","233043","266860","243700","297693","289736","178046","202905","271722","202957","173344","271369","262480","440574","174718","276650","5854033","267153","274916","606666","2978151","3710926","281784","169065","157687","329656","196964","333301","333063","319062","272813","309857","258986","242032","268344","267688","237035","226903","269239","159024","255378","212279","235995","274675","262002","246169","260671","332540","275008","177229","263654","331615","262173","305792","168587","261555","1404528","240393","196780","267072","212231","278258","274194","1914792","3504036","7651733","379535","308340","312826","6606660","1794287","156908","122097","251074","292742","334411","273993","404865","327177","245204","265122","200918","278269","289876","333343","3679666","402936","412657","1612436","1613927","127419","142101","146615","159204","223983","169579","313349","238187","191575","260465","273776","331529","290052","332947","309222","270663","322014","327974","335565","313773","336003","333248","270813","294923","280417","156537","234187","143610","308200","264791","253148","265381","260525","287754","287595","230773","273994","232601","239469","19909","301901","193813","239120","202719","1481024","159038","863659","268021","72395","265329","270066","1516090","185492","308203","333060","273000","333659","333888","310741","308945","180347","367502","678181","272600","218848","311166","262873","308575","334007","143599","239012","272143","265517","215475","391021","230640","170157","180246","672674","266094","323035","220943","328605","311177","238232","1591464","278500","158731","199820","264850","194676","261136","314596","284979","1220496","6972430","5525195","5643435","1395321","6112594","1431107","4813927","334113","155355","276755","220943","161327","317373","309924","325562","317715","317752","322947","317546","329695","333300","333666","2163","15339","112887","120025","140850","157590","162374","165443","190909","180238","180264","196160","117341","117894","119814","120876","124717","132806","141355","152034","155460","162009","164334","166292","170383","170985","171414","171920","174556","174877","178800","179777","181527","181883","182387","182822","185068","185382","185621","202537","202770","211573","212407","217118","217979","219618","220915","222680","230664","231240","233592","236541","238100","238215","238638","239843","240002","241870","248162","250169","253830","255401","255609","256128","257811","258796","260118","260357","260381","260571","260805","261096","261543","262229","262486","262624","262657","262875","264019","264065","264145","264686","265279","266110","266127","266280","266493","266748","267184","268494","268914","270804","271634","272511","272580","272739","273110","273787","273818","274002","274006","274055","275066","275067","275287","275366","276105","277366","278423","278542","278585","279479","279996","284256","284962","285098","285479","289249","289811","291305","296903","305175","308185","308196","308863","309058","309245","309688","310136","310148","310685","310687","310913","311068","313191","315664","317745","317748","317987","321640","322321","323037","324430","329458","330393","331512","331572","332146","332483","332640","332827","332880","332881","333049","333071","333170","333192","308681","6212895","333354","2019746","401443","159076","294500","1149838","4103460","412657","455094","404797","1587883","3237735","369138","2012696","1629706","3054424","3203738","1861644","429339","318736","336441","273769","310247","187001","185382","185698","979740","333068","6572872","424513","334735","601203","202770","252735","334278","333653","268479","1876139","374078","400254","401869","332861","306241","353209","337720","213589","1151155","655877","334160","332014","241035","274910","287586","335457","309055","333676","336092","336144","333590","268239","269408","303246","239559","333973","334614","417168","306570","569819","333922","211902","253800","5577611","521552","7644083","337710","277260","276830","327167","323036","248760","236497","442035","334811","289376","334449","335564","368129","332864","3460996","333074","1640638","276388","334565","7178786","701899","276960","272020","240196","533491","243335","1422689","1248838","703606","308205","5578052","350258","181979","333673","529024","411536","333861","333044","220239","842585"}
  2.  
  3. local mainAdmin = "Villaaam#0000" -- MAIN ADMIN
  4. local perm = { ['Villaaam#0000'] = true, ['Whyson2#4532'] = true} -- Admins
  5. local players = {}
  6. local data = {}
  7. local canFinish = false
  8. local kicking = false
  9. local startGame = false
  10. local finishGame = false
  11.  
  12. local queueMaps = {}
  13.  
  14. local maxPlayers = 200
  15. local playersInGame = 0
  16.  
  17. local mapName = 'Villaaam#0000'
  18. local mapCode = '17'
  19. local roundWinner = ''
  20. local mapWinner = ''
  21.  
  22.  
  23. ---Players Name Color In the Starting Map--
  24. local nameColor = "#FD06D9" --Change the color code in here!
  25.  
  26. function mapChange()
  27.     if #queueMaps > 0 then
  28.         tfm.exec.newGame(queueMaps[1])
  29. queueMaps[1] = nil
  30.     else
  31.         tfm.exec.newGame(mapList[math.random(0, #mapList)])
  32.     end
  33. end
  34.  
  35. -- [[ Disable ]] --
  36. system.disableChatCommandDisplay(nil)
  37.  
  38. for _, v in next, {'AutoTimeLeft', 'AutoShaman', 'AutoNewGame', 'AutoScore', 'AfkDeath', 'PhysicalConsumables'} do
  39.     tfm.exec['disable' .. v]()
  40. end
  41.  
  42. -- [[ Functions Lib ]] --
  43. local split = function(str, s)
  44.     local res = {}
  45.     for part in string.gmatch(str, "[^" .. s .. "]+") do
  46.         table.insert(res, part)
  47.     end
  48.     return res
  49. end
  50.  
  51. local showPlayers = function(name, display)
  52.     if (display == nil) then display = true end
  53.  
  54.     local addTextArea = function(...) if (display) then ui.addTextArea(...) end end
  55.    
  56.     if (playersInGame > 0) then
  57.         local a = 1
  58.      
  59.         local list = { "<p align='center'>" }
  60.         local n, i, id = 0, 1, 1
  61.    
  62.         local text = ''
  63.      
  64.         for k in next, players do
  65.             if (k ~= name) then
  66.                 local nick, tag = k:match('(.-)#(%d+)');tag = "<g><font size='9'>#" .. tag .. "</font></g>"
  67.        
  68.                 n = (n + 1)
  69.                 if (n >= 10) then
  70.                     i = (i + 1);list[i] = "<p align='center'>"
  71.  
  72.                     text = (kicking and "<a href='event:" .. k .. "'>" or '') .. nick .. tag .. '\n'
  73.  
  74.                     n = 1
  75.          
  76.                     id = (id + 1)
  77.                 else
  78.                     text = (kicking and "<a href='event:" .. k .. "'>" or '') .."<font color='" ..nameColor .."'>" ..nick ..tag ..'\n'
  79.                 end
  80.        
  81.                 list[i] = list[i] .. text
  82.             end
  83.         end
  84.  
  85.         local x = 6
  86.         for i = 1, #list do
  87.             addTextArea(i, list[i], name, x, 80, 180, 310, 0x060606, 0x060606, .8, true)
  88.        
  89.             x = (x + (i == 1 and 193 or 203))
  90.         end
  91.    
  92.         if (kicking) then
  93.             addTextArea(0, "<p align='center'><font size='16'><font face='Candara'><font color='#8B00FF'>Select a player to eliminate", name, 5, 25, 790, 25, 0x060606, 0, .8)
  94.         end
  95.    
  96.         return #list
  97.     end
  98. end
  99.  
  100.  
  101.  
  102. local start = function()
  103.     playersInGame = 0
  104.  
  105. tfm.exec.newGame('<C><P Ca=""/><Z><S><S L="795" o="66666" H="56" X="401" Y="373" T="12" P="0,0,0.3,0.2,0,0,0,0" i="-4,-398,170b5453177.jpg" /></S><D /><O /></Z></C>')
  106.  
  107.     for k in next, perm do
  108.         ui.addTextArea(-1, "<p align='center'><a href='event:start'><font size='13' color='#FFB710'><font face='Candara'><n><b><font color='#FD06D9'>Start Game", k, 5, 25, 150, 20, 0x060606, 0, .8)
  109.     end
  110.  
  111.     ui.addTextArea(0, "<p align='center'><a href='event:entry'><font size='13' color='#FFB710'><font face='Candara'><n><b><font color='#FD06D9'>Join", nil, 644, 25, 150, 20, 0x060606, 0, .8)
  112.  
  113.     for k in next, tfm.get.room.playerList do
  114.         tfm.exec.setPlayerScore(k, 0)
  115.     end
  116.  
  117.     showPlayers(nil)
  118. end
  119.  
  120. system.bindMouse("Villaaam#0000", true)
  121. system.bindMouse("Whyson2#4532", true)
  122. function eventMouse(name, x, y)
  123.     tfm.exec.movePlayer(name,x,y,false,0,0,true)
  124. end
  125.  
  126.  
  127. -- [[ API Functions ]] --
  128. function eventNewPlayer(name)
  129.     if not data[name] then
  130.         data[name] = {color=0xF734B9}
  131.     end
  132.     tfm.exec.setNameColor(name, data[name].color)
  133.     if (not startGame) then
  134.         local text = "<p align='center'><j>Joined"
  135.         if (not players[name]) then
  136.             text = "<p align='center'><a href='event:entry'><font size='13' color='#FFB710'><font face='Candara'><n><b>Join"            
  137.         end
  138.  
  139.         ui.addTextArea(0, text, name, 644, 25, 150, 20, 0x060606, 0, .8)
  140.  
  141.         showPlayers(name)
  142.     end
  143.  
  144.     tfm.exec.setPlayerScore(name, 0)
  145. end
  146. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  147.  
  148. function eventNewGame()
  149.     canFinish = false
  150.     kicking = false
  151.  
  152.     mapWinner = ''
  153.  
  154.     for name, player in next, tfm.get.room.playerList do
  155.         if (perm[name] and data[name]) then
  156.             tfm.exec.setNameColor(name, data[name].color)
  157.         end
  158.     end
  159.  
  160.     if (startGame) then
  161.         ui.removeTextArea(0);local a = showPlayers('?', false);for b = 1, a do ui.removeTextArea(b, name) end
  162.  
  163.         tfm.exec.addPhysicObject(0, 380, -325, {type = 14, width = 40, height = 10})
  164.         tfm.exec.addPhysicObject(1, 380, -365, {type = 14, width = 60, height = 10})
  165.         tfm.exec.addPhysicObject(2, 355, -340, {type = 14, width = 40, height = 10, angle = -90})
  166.         tfm.exec.addPhysicObject(3, 405, -340, {type = 14, width = 40, height = 10, angle = -90})
  167.  
  168.         for k in next, tfm.get.room.playerList do
  169.             if (not players[k]) then
  170.                 tfm.exec.movePlayer(k, 380, -340)
  171.             end
  172.         end
  173.    
  174.         tfm.exec.setGameTime(63)
  175.         ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
  176.         if (roundWinner ~= '') then
  177.             if (finishGame) then
  178.                 if (players[roundWinner] and #players[roundWinner] > 0) then
  179.                     local text = 'Eliminated: '
  180.  
  181.                     for i = 1, #players[roundWinner] do
  182.                         local nick, tag = '<n>' .. players[roundWinner][i]:match('(.-)#[0-9]+$'), "<ch><font size='9'>" .. players[roundWinner][i]:match('#[0-9]+$')
  183.                         text = text .. nick .. tag .. (i < #players[roundWinner] and '<n>,</n> ' or '<n>.</n>')
  184.                     end
  185.  
  186.                     ui.addTextArea(0, text, nil, 5, 25, 200, nil, 0x060606, 0, .8)
  187.                 end
  188.                 tfm.exec.setGameTime(30)
  189.                 tfm.exec.setUIMapName("<O>Created by</O> <ROSE>Villaaam#0000</ROSE>")
  190.             end
  191.         end
  192.     else
  193.         players = {}
  194.    
  195.         tfm.exec.setGameTime(99999)
  196.     end
  197.  
  198.     mapName = (tfm.get.room.xmlMapInfo.author ~= '#Module' and tfm.get.room.xmlMapInfo.author or mapName)
  199.     mapCode = tfm.get.room.currentMap or mapCode
  200. end
  201.  
  202. function eventLoop(elapsed, remaining)
  203.     local remaining = math.floor(remaining / 1000)
  204.  
  205.     if (elapsed <= 1000) then
  206.         tfm.exec.playEmote(roundWinner, 0)
  207.     end
  208.  
  209.     if (remaining < 0) then
  210.         if (finishGame) then
  211.             finishGame = false
  212.             startGame = false
  213.  
  214.             start()
  215.  
  216.             return
  217.         end
  218.  
  219.         if (startGame) then
  220.             if (canFinish and roundWinner ~= '') then
  221.                 finishGame = true
  222.                 tfm.exec.newGame('<C><P /><Z><S><S i="-200,-250,16692e791eb.png" P=",,9999,,,,," L="400" H="10" Y="270" T="14" X="400" /><S P=",,9999,,,,," i="-66,-20,1669252905c.png" L="200" H="10" Y="300" T="14" X="400" /></S><D><DS Y="300" X="400" /></D><O /></Z></C>')
  223.             else
  224.                     mapChange()
  225.             end
  226.         else
  227.             ui.removeTextArea(0)
  228.  
  229.             start()
  230.         end
  231.     end
  232. end
  233.  
  234. function eventPlayerWon(name)
  235.     if (startGame) then
  236.         if (mapWinner == '') then
  237.             mapWinner = name
  238.  
  239.             local a = 0
  240.             for k in next, players do
  241.                 a = (a + 1)
  242.             end
  243.             if (a > 2) then
  244.                 kicking = true
  245.                 tfm.exec.setGameTime(10, false)
  246.  
  247.                 showPlayers(name)
  248.             else
  249.                 for k in next, players do
  250.                     if (k ~= name) then
  251.                         players[k] = nil
  252.  
  253.                         break
  254.                     end
  255.                 end
  256.  
  257.                 canFinish = true
  258.  
  259.                 roundWinner = name
  260.  
  261.                 tfm.exec.setGameTime(4, false)
  262.             end
  263.  
  264.             tfm.exec.setPlayerScore(name, tfm.get.room.playerList[name].score + 1)
  265.         end
  266.     end
  267. end
  268.  
  269. function eventPlayerDied(name)
  270.     local t = {}
  271.  
  272.     for k, v in next, tfm.get.room.playerList do
  273.         if (not v.isDead) then
  274.             t[#t + 1] = k
  275.         end
  276.     end
  277.  
  278.     for i = 1, #t do
  279.         if (players[t[i]]) then
  280.             return
  281.         end
  282.     end
  283.  
  284.     if (startGame) then
  285.         mapChange()
  286.     end
  287. end
  288.  
  289. function eventPlayerLeft(name)
  290.     if (players[name]) then
  291.         players[name] = nil
  292.        
  293.         if (playersInGame > 0) then playersInGame = (playersInGame - 1) end
  294.         ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
  295.     end
  296.  
  297.     if (not startGame) then
  298.         showPlayers(nil)
  299.     end
  300.  
  301.     if (kicking) then
  302.         showPlayers(mapWinner)
  303.     end
  304. end
  305.  
  306. function eventChatCommand(name, cmd)
  307.     cmd = split(cmd, ' ')
  308.  
  309.     -- [[ Adm Commands ]] --
  310.     if (perm[name]) then
  311.         if (cmd[1] == 'start') then
  312.             local a = playersInGame
  313.             if (a > 1) then
  314.                 for i = -1, a do
  315.                     ui.removeTextArea(i)
  316.                 end
  317.  
  318.                 startGame = true
  319.  
  320.                 mapChange()
  321.             end
  322.         elseif cmd[1] == 'kill' and cmd[2] ~= nil then
  323.             tfm.exec.killPlayer(cmd[2])
  324.         elseif cmd[1] == 'skip' then
  325.             mapChange()
  326.         elseif name:lower() == mainAdmin:lower() and cmd[1] == 'admin' and cmd[2] ~= nil then
  327.             if perm[cmd[2]] then
  328.                 perm[cmd[2]] = false
  329.                 for name, value in next, perm do
  330.                     ui.addPopup(1, 0, string.format("%s is not Admin anymore.", cmd[2]), name, 250, 170, 300, true)
  331.                 end
  332.             else
  333.                 perm[cmd[2]] = true
  334.                 for name, value in next, perm do
  335.                     ui.addPopup(1, 0, string.format("%s is now Admin.", cmd[2]), name, 250, 170, 300, true)
  336.                 end
  337.             end
  338.         elseif cmd[1] == 'np' and cmd[2] ~= nil then
  339.             table.insert(queueMaps, cmd[2])
  340.         elseif cmd[1] == 'namecolor' then
  341.             ui.showColorPicker(1661, name, data[name].color or 0xFFFFFF, "Choose name color")
  342.         end
  343.     end
  344. end
  345.  
  346. function eventColorPicked(id, name, color)
  347.     if id == 1661 then
  348.         if perm[name] and data[name] then
  349.             data[name].color = color
  350.             tfm.exec.setNameColor(name, color)
  351.         end
  352.     end
  353. end
  354.  
  355. function eventTextAreaCallback(id, name, cb)
  356.     if (cb == 'entry') then
  357.         if (not players[name]) then
  358.             players[name] = {color = 0xF734B9}
  359.  
  360.             playersInGame = (playersInGame + 1)
  361.            ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
  362.             ui.updateTextArea(0, '<n>Joined', name)
  363.  
  364.             showPlayers(nil)
  365.         end
  366.     elseif (cb == 'start') then
  367.         eventChatCommand(name, cb)
  368.     elseif (players[cb] and kicking) then
  369.         if (playersInGame > 0) then playersInGame = (playersInGame - 1) end
  370.  
  371.         kicking = false
  372.         players[cb] = nil
  373.  
  374.         local a = 1
  375.         for k in next, players do
  376.             a = (a + 1)
  377.         end
  378.         for i = 1, a do
  379.             ui.removeTextArea(i)
  380.         end
  381.  
  382.         players[name][#players[name] + 1] = cb
  383.        
  384.       ui.addTextArea(0, "<p align='center'><font size='26'><font face='Candara'><font color='#8B00FF'><b>" .. name .. " <font face='Candara'><font color='#060606'>eliminated: <font color='#FD06D9'><b>" .. cb, nil, 6, 186, 790, 35, 0x060606, 0, .8)
  385.    
  386.             ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
  387.         tfm.exec.setGameTime(15, false)
  388.     end
  389. end
  390.  
  391. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement