Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"}
- local mainAdmin = "Villaaam#0000" -- MAIN ADMIN
- local perm = { ['Villaaam#0000'] = true, ['Whyson2#4532'] = true} -- Admins
- local players = {}
- local data = {}
- local canFinish = false
- local kicking = false
- local startGame = false
- local finishGame = false
- local queueMaps = {}
- local maxPlayers = 200
- local playersInGame = 0
- local mapName = 'Villaaam#0000'
- local mapCode = '17'
- local roundWinner = ''
- local mapWinner = ''
- ---Players Name Color In the Starting Map--
- local nameColor = "#FD06D9" --Change the color code in here!
- function mapChange()
- if #queueMaps > 0 then
- tfm.exec.newGame(queueMaps[1])
- queueMaps[1] = nil
- else
- tfm.exec.newGame(mapList[math.random(0, #mapList)])
- end
- end
- -- [[ Disable ]] --
- system.disableChatCommandDisplay(nil)
- for _, v in next, {'AutoTimeLeft', 'AutoShaman', 'AutoNewGame', 'AutoScore', 'AfkDeath', 'PhysicalConsumables'} do
- tfm.exec['disable' .. v]()
- end
- -- [[ Functions Lib ]] --
- local split = function(str, s)
- local res = {}
- for part in string.gmatch(str, "[^" .. s .. "]+") do
- table.insert(res, part)
- end
- return res
- end
- local showPlayers = function(name, display)
- if (display == nil) then display = true end
- local addTextArea = function(...) if (display) then ui.addTextArea(...) end end
- if (playersInGame > 0) then
- local a = 1
- local list = { "<p align='center'>" }
- local n, i, id = 0, 1, 1
- local text = ''
- for k in next, players do
- if (k ~= name) then
- local nick, tag = k:match('(.-)#(%d+)');tag = "<g><font size='9'>#" .. tag .. "</font></g>"
- n = (n + 1)
- if (n >= 10) then
- i = (i + 1);list[i] = "<p align='center'>"
- text = (kicking and "<a href='event:" .. k .. "'>" or '') .. nick .. tag .. '\n'
- n = 1
- id = (id + 1)
- else
- text = (kicking and "<a href='event:" .. k .. "'>" or '') .."<font color='" ..nameColor .."'>" ..nick ..tag ..'\n'
- end
- list[i] = list[i] .. text
- end
- end
- local x = 6
- for i = 1, #list do
- addTextArea(i, list[i], name, x, 80, 180, 310, 0x060606, 0x060606, .8, true)
- x = (x + (i == 1 and 193 or 203))
- end
- if (kicking) then
- 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)
- end
- return #list
- end
- end
- local start = function()
- playersInGame = 0
- 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>')
- for k in next, perm do
- 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)
- end
- 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)
- for k in next, tfm.get.room.playerList do
- tfm.exec.setPlayerScore(k, 0)
- end
- showPlayers(nil)
- end
- system.bindMouse("Villaaam#0000", true)
- system.bindMouse("Whyson2#4532", true)
- function eventMouse(name, x, y)
- tfm.exec.movePlayer(name,x,y,false,0,0,true)
- end
- -- [[ API Functions ]] --
- function eventNewPlayer(name)
- if not data[name] then
- data[name] = {color=0xF734B9}
- end
- tfm.exec.setNameColor(name, data[name].color)
- if (not startGame) then
- local text = "<p align='center'><j>Joined"
- if (not players[name]) then
- text = "<p align='center'><a href='event:entry'><font size='13' color='#FFB710'><font face='Candara'><n><b>Join"
- end
- ui.addTextArea(0, text, name, 644, 25, 150, 20, 0x060606, 0, .8)
- showPlayers(name)
- end
- tfm.exec.setPlayerScore(name, 0)
- end
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- function eventNewGame()
- canFinish = false
- kicking = false
- mapWinner = ''
- for name, player in next, tfm.get.room.playerList do
- if (perm[name] and data[name]) then
- tfm.exec.setNameColor(name, data[name].color)
- end
- end
- if (startGame) then
- ui.removeTextArea(0);local a = showPlayers('?', false);for b = 1, a do ui.removeTextArea(b, name) end
- tfm.exec.addPhysicObject(0, 380, -325, {type = 14, width = 40, height = 10})
- tfm.exec.addPhysicObject(1, 380, -365, {type = 14, width = 60, height = 10})
- tfm.exec.addPhysicObject(2, 355, -340, {type = 14, width = 40, height = 10, angle = -90})
- tfm.exec.addPhysicObject(3, 405, -340, {type = 14, width = 40, height = 10, angle = -90})
- for k in next, tfm.get.room.playerList do
- if (not players[k]) then
- tfm.exec.movePlayer(k, 380, -340)
- end
- end
- tfm.exec.setGameTime(63)
- ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
- if (roundWinner ~= '') then
- if (finishGame) then
- if (players[roundWinner] and #players[roundWinner] > 0) then
- local text = 'Eliminated: '
- for i = 1, #players[roundWinner] do
- local nick, tag = '<n>' .. players[roundWinner][i]:match('(.-)#[0-9]+$'), "<ch><font size='9'>" .. players[roundWinner][i]:match('#[0-9]+$')
- text = text .. nick .. tag .. (i < #players[roundWinner] and '<n>,</n> ' or '<n>.</n>')
- end
- ui.addTextArea(0, text, nil, 5, 25, 200, nil, 0x060606, 0, .8)
- end
- tfm.exec.setGameTime(30)
- tfm.exec.setUIMapName("<O>Created by</O> <ROSE>Villaaam#0000</ROSE>")
- end
- end
- else
- players = {}
- tfm.exec.setGameTime(99999)
- end
- mapName = (tfm.get.room.xmlMapInfo.author ~= '#Module' and tfm.get.room.xmlMapInfo.author or mapName)
- mapCode = tfm.get.room.currentMap or mapCode
- end
- function eventLoop(elapsed, remaining)
- local remaining = math.floor(remaining / 1000)
- if (elapsed <= 1000) then
- tfm.exec.playEmote(roundWinner, 0)
- end
- if (remaining < 0) then
- if (finishGame) then
- finishGame = false
- startGame = false
- start()
- return
- end
- if (startGame) then
- if (canFinish and roundWinner ~= '') then
- finishGame = true
- 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>')
- else
- mapChange()
- end
- else
- ui.removeTextArea(0)
- start()
- end
- end
- end
- function eventPlayerWon(name)
- if (startGame) then
- if (mapWinner == '') then
- mapWinner = name
- local a = 0
- for k in next, players do
- a = (a + 1)
- end
- if (a > 2) then
- kicking = true
- tfm.exec.setGameTime(10, false)
- showPlayers(name)
- else
- for k in next, players do
- if (k ~= name) then
- players[k] = nil
- break
- end
- end
- canFinish = true
- roundWinner = name
- tfm.exec.setGameTime(4, false)
- end
- tfm.exec.setPlayerScore(name, tfm.get.room.playerList[name].score + 1)
- end
- end
- end
- function eventPlayerDied(name)
- local t = {}
- for k, v in next, tfm.get.room.playerList do
- if (not v.isDead) then
- t[#t + 1] = k
- end
- end
- for i = 1, #t do
- if (players[t[i]]) then
- return
- end
- end
- if (startGame) then
- mapChange()
- end
- end
- function eventPlayerLeft(name)
- if (players[name]) then
- players[name] = nil
- if (playersInGame > 0) then playersInGame = (playersInGame - 1) end
- ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
- end
- if (not startGame) then
- showPlayers(nil)
- end
- if (kicking) then
- showPlayers(mapWinner)
- end
- end
- function eventChatCommand(name, cmd)
- cmd = split(cmd, ' ')
- -- [[ Adm Commands ]] --
- if (perm[name]) then
- if (cmd[1] == 'start') then
- local a = playersInGame
- if (a > 1) then
- for i = -1, a do
- ui.removeTextArea(i)
- end
- startGame = true
- mapChange()
- end
- elseif cmd[1] == 'kill' and cmd[2] ~= nil then
- tfm.exec.killPlayer(cmd[2])
- elseif cmd[1] == 'skip' then
- mapChange()
- elseif name:lower() == mainAdmin:lower() and cmd[1] == 'admin' and cmd[2] ~= nil then
- if perm[cmd[2]] then
- perm[cmd[2]] = false
- for name, value in next, perm do
- ui.addPopup(1, 0, string.format("%s is not Admin anymore.", cmd[2]), name, 250, 170, 300, true)
- end
- else
- perm[cmd[2]] = true
- for name, value in next, perm do
- ui.addPopup(1, 0, string.format("%s is now Admin.", cmd[2]), name, 250, 170, 300, true)
- end
- end
- elseif cmd[1] == 'np' and cmd[2] ~= nil then
- table.insert(queueMaps, cmd[2])
- elseif cmd[1] == 'namecolor' then
- ui.showColorPicker(1661, name, data[name].color or 0xFFFFFF, "Choose name color")
- end
- end
- end
- function eventColorPicked(id, name, color)
- if id == 1661 then
- if perm[name] and data[name] then
- data[name].color = color
- tfm.exec.setNameColor(name, color)
- end
- end
- end
- function eventTextAreaCallback(id, name, cb)
- if (cb == 'entry') then
- if (not players[name]) then
- players[name] = {color = 0xF734B9}
- playersInGame = (playersInGame + 1)
- ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
- ui.updateTextArea(0, '<n>Joined', name)
- showPlayers(nil)
- end
- elseif (cb == 'start') then
- eventChatCommand(name, cb)
- elseif (players[cb] and kicking) then
- if (playersInGame > 0) then playersInGame = (playersInGame - 1) end
- kicking = false
- players[cb] = nil
- local a = 1
- for k in next, players do
- a = (a + 1)
- end
- for i = 1, a do
- ui.removeTextArea(i)
- end
- players[name][#players[name] + 1] = cb
- 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)
- ui.setMapName("<font color='#98E2EB'><a:active>x1eliminatoria</a:active> <a:active>|</a:active> <V>Competidores: </V>"..playersInGame.." / "..maxPlayers)
- tfm.exec.setGameTime(15, false)
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement