Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admins={Umielyon=true, Cgtmouse=true, Kageroutea=true}
- Admins={'Umielyon', 'Cgtmouse','Kageroutea'}
- function isAdmin(name)
- return (admins[name] or false)
- end
- alive = 0
- maps = {[[0]], [[1]], [[2]], [[3]], [[4]], [[5]], [[6]], [[10]], [[11]], [[12]], [[13]], [[15]], [[16]], [[17]], [[18]], [[19]], [[20]], [[21]], [[24]], [[25]], [[26]], [[27]], [[30]], [[31]], [[32]], [[34]], [[35]], [[36]], [[37]], [[38]], [[39]], [[40]], [[41]], [[44]], [[45]], [[46]], [[47]], [[48]], [[49]], [[50]], [[51]], [[52]], [[53]], [[54]], [[56]], [[59]], [[60]], [[62]], [[63]], [[64]], [[65]], [[66]], [[67]], [[68]], [[69]], [[71]], [[72]], [[73]], [[75]], [[76]], [[79]], [[80]], [[81]], [[86]], [[90]], [[91]], [[92]], [[93]], [[94]], [[95]], [[96]], [[97]], [[98]], [[99]], [[100]], [[114]], [[115]], [[116]], [[117]], [[118]], [[119]], [[120]], [[121]], [[127]], [[128]], [[129]], [[130]], [[131]], [[132]], [[133]], [[134]], [[136]], [[138]], [[139]], [[140]], [[141]], [[142]], [[143]], [[3298059]], [[5042951]], [[5049504]], [[5088589]], [[5054044]], [[3298059]], [[4186033]], [[433332]], [[1964128]], [[1406626]], [[743739]], [[126092]], [[413242]], [[909734]], [[183760]], [[1124454]], [[776051]], [[1836964]], [[187088]], [[773147]], [[426398]], [[3820670]], [[3017381]], [[367747]], [[357214]], [[371007]], [[365734]], [[444118]], [[607131]], [[2104751]], [[2199656]], [[953233]], [[515250]], [[923878]], [[398828]], [[382841]], [[423670]], [[436128]], [[1193841]], [[772825]], [[239941]], [[504166]], [[392150]], [[172357]], [[3534630]], [[474113]], [[1655360]], [[199112]], [[798052]], [[151712]], [[213781]], [[453948]], [[324373]], [[168872]], [[165741]], [[460646]], [[421195]], [[438271]], [[461925]], [[853788]], [[474477]], [[5189816]]}
- easymaps = {[[4]], [[16]], [[43]], [[44]], [[45]], [[93]], [[94]]}
- intermediatemaps = {[[130]],}
- hardmaps = {[[10]], [[66]], [[79]], [[120]]}
- house = {[[4445759]], [[4709828]], [[4583680]]}
- bans={}
- function isBanned(name)
- return(bans[name] or false)
- end
- players={}
- namecolor={}
- holding={}
- vqueue={}
- aMenu={
- actions={{'New Map', tfm.exec.newGame, {'Map Code'}, {0}}, {'Set Time', tfm.exec.setGameTime, {'Time', 'Init'}, {120}},
- {'Add Object', tfm.exec.addShamanObject, {'ID', 'X', 'Y', 'Angle', 'Speed X', 'Speed Y', 'Ghost'}, {28, 800, 700, 0, 0, 0}}, {'Remove Object', tfm.exec.removeObject, {'ID'}, {2}},
- {'Move Object', tfm.exec.moveObject, {'ID', 'X', 'Y', 'Offset', 'Speed X', 'Speed Y', 'Offset'}, {2, 10, 10}},
- {'Particle', tfm.exec.displayParticle, {'ID', 'X', 'Y', 'Speed X', 'Speed Y', 'Acceleration X', 'Acceleration Y', 'Target'}, {1, 10, 10, 0, 0, 0, 0}},
- {'Explosion', tfm.exec.explosion, {'X', 'Y', 'Power', 'Distance', 'Mice Only'}, {400, 200, -100, 100}},
- {'Conjuration', tfm.exec.addConjuration, {'X', 'Y', 'Time'}, {10/10, 10/10, 10000}},
- 'NICK', {'Kill', tfm.exec.killPlayer}, {'Give Cheese', tfm.exec.giveCheese}, {'Victory', tfm.exec.playerVictory},
- {'Shaman', tfm.exec.setShaman}, {'Meep', tfm.exec.giveMeep}, {'Vampire', tfm.exec.setVampirePlayer},
- {'Respawn', tfm.exec.respawnPlayer}, {'Set Score', tfm.exec.setPlayerScore, {'Score', 'Add'}, {1, true}},
- {'Set Color', tfm.exec.setNameColor, {'Color'}, {0}},
- {'Move Player', tfm.exec.movePlayer, {'X', 'Y', 'Offset', 'Speed X', 'Speed Y', 'Offset'}, {400, 200}}},
- text='<R><a href="event:close"><b>Close</b></a><N>',
- nickID=0}
- langs = {
- EN = {
- clear="Clear",
- close="Close",
- shaman="Become Shaman",
- changemap="Change Map",
- changemapattempt="attempted to change the map!",
- exit=" has left the room.",
- teleport="Toggle Teleportation",
- color="Name Color",
- resetmap="Reset Map",
- fly="Toggle Flight",
- meep="Give Meep",
- time="Infinite Map Time",
- path="Toggle Path (WIP)",
- snowball="Super Snowball",
- heart="Heart Clicks",
- gravity="No Gravity",
- admin="Admin Menu",
- banned="You are banned from this room!",
- vanillamode="Sham Practice Mode",
- rules=" Video Player Rules (WIP):\n\n1. You must abide by the video queue.\n\n2. If a video is longer than around 6 mins, after that allotted time another video may be played at any time. There are exceptions that can be made.\n\n3. Please be respectful of other people's video choices.\n\n4. Try to avoid playing videos that are looping videos of clips that are really short.",
- joinqueue="Join Queue",
- leavequeue="Leave Queue",
- vqueuetitle="Video Queue:\n\n",
- vqueuetext="",
- toggleui="Toggle UI"
- }
- }
- text = langs.EN
- function init()
- command.addHandler("cp", cp)
- for i=1, #aMenu.actions do
- if aMenu.actions[i]=='NICK' then
- aMenu.text=aMenu.text..'\n<V><u>%s</u><J>'
- aMenu.nickID=i
- else
- aMenu.text=aMenu.text..string.format('\n<a href="event:amenu%d">%s</a>', i, aMenu.actions[i][1])
- if aMenu.actions[i][3] then
- aMenu.text=aMenu.text..string.format(' <a href="event:amenup%d">></a>', i)
- end
- end
- end
- teleandflylock = false
- snowballlock = false
- X = 0
- Y = 0
- ID = 0
- Angle = 0
- SpeedX = 0
- SpeedY = 0
- umielyonx = 0
- umielyony = 0
- cgtmousex = 0
- cgtmousey = 0
- kagerouteax = 0
- kagerouteay = 0
- place = 0
- totalplayers = 0
- vanillamodevote = 0
- for name in pairs(tfm.get.room.playerList) do
- holding[name] = false
- eventNewPlayer(name)
- end
- end
- function updateVQueueText()
- text.vqueuetext = ""
- for trash in pairs(vqueue) do
- text.vqueuetext = text.vqueuetext..vqueue[trash].."\n"
- end
- end
- function eventNewPlayer(name)
- tfm.exec.respawnPlayer(name)
- alive = alive+1
- if totalplayers == nil then
- totalplayers = 0
- end
- totalplayers = totalplayers+1
- if isBanned(name) ~= true then
- ui.addTextArea(104, "<a href='event:shaman'><B>"..text.shaman.."</a>", name, -200, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(105, "<a href='event:changemap'><B>"..text.changemap.."</a>", name, -200, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(112, "<a href='event:vanillamode'><N2>"..text.vanillamode.."</a>", name, -200, 100, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", name, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", name, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(108, "<a href='event:meep'><B>"..text.meep.."</a>", name, -200, 190, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(109, "<a href='event:color'><B>"..text.color.."</a>", name, -200, 220, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(110, "<a href='event:close'><N2>"..text.path.."</a>", name, -200, 250, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(111, "<a href='event:snowball'><N2>"..text.snowball.."</a>", name, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(300, "<a href='event:joinqueue'><B>"..text.joinqueue.."</a>", name, 850, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(301, "<a href='event:leavequeue'><N2>"..text.leavequeue.."</a>", name, 850, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- updateVQueueText()
- ui.addTextArea(302, "<B>"..text.vqueuetitle.."</B>"..text.vqueuetext, name, 850, 130, 150, 200, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(400, "<a href='event:toggleui'><B>"..text.toggleui.."</a>", name, 850, 575, 150, 20, 0x000001, 0x000001, 1, true)
- end
- time = 0
- if isAdmin(name) then
- ui.addTextArea(153, "<a href='event:heart'>"..text.heart.."</a>", name, -200, 495, 150, 20, 0x000001, 0x000001, 1, true)
- ui.addTextArea(152, "<a href='event:gravity'>"..text.gravity.."</a>", name, -200, 515, 150, 20, 0x000001, 0x000001, 1, true)
- ui.addTextArea(151, "<a href='event:time'><ROSE>"..text.time.."</a>", name, -200, 535, 150, 20, 0x000001, 0x000001, 1, true)
- ui.addTextArea(150, "<a href='event:resetmap'><R>"..text.resetmap.."</a>", name, -200, 555, 150, 20, 0x000001, 0x000001, 1, true)
- ui.addTextArea(149, "<a href='event:admin'><J>"..text.admin.."</a>", name, -200, 575, 150, 20, 0x000001, 0x000001, 1, true)
- -- Rules here for now
- -- ui.addPopup(1337, 0, rules, name, 200, 150, 400, true)
- end
- mapcode = tfm.get.room.currentMap
- if mapcode == "@4445759" then
- tfm.exec.setUIMapName("<VP>Cloud Strife - House")
- else
- tfm.exec.setUIMapName("<VP>Cloud Strife - Map "..mapcode)
- end
- players[name]={keys={}, aMenu={target=name, pID=0, params={}}}
- system.bindMouse(name, true)
- tfm.exec.bindKeyboard(name, 16, true, true)
- tfm.exec.bindKeyboard(name, 16, false, true)
- tfm.exec.bindKeyboard(name, 17, true, true)
- tfm.exec.bindKeyboard(name, 17, false, true)
- tfm.exec.bindKeyboard(name, 107, true, true)
- for name in pairs(namecolor) do
- if namecolor[name] ~= nil then
- tfm.exec.setNameColor(name, "0x"..namecolor[name])
- end
- end
- end
- function eventPlayerLeft(playerName)
- ui.addTextArea(786, "<V>"..playerName.." "..text.exit.." <p align='right'><R><a href='event:close'>X</a></p>", playerList, 400, 375, 300, 20, 1, true)
- totalplayers = totalplayers-1
- alive = alive-1
- -- Video Queue Removal
- for trash in pairs(vqueue) do
- if vqueue[trash] == playerName then
- table.remove(vqueue, trash)
- ui.removeTextArea(302, playerList)
- updateVQueueText()
- ui.addTextArea(302, "<B>"..text.vqueuetitle.."</B>"..text.vqueuetext, playerList, 850, 130, 150, 160, 0x465A6E, 0x324650, 1, true)
- break
- end
- end
- end
- for name, player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventPlayerDied(name)
- tfm.exec.setPlayerScore(name,-1,true)
- if vanillamodeon == true then
- alive = alive-1
- else
- tfm.exec.respawnPlayer(name)
- end
- for name in pairs(namecolor) do
- if namecolor[name] ~= nil then
- tfm.exec.setNameColor(name, "0x"..namecolor[name])
- end
- end
- end
- function eventPlayerRespawn(name)
- for name in pairs(namecolor) do
- if namecolor[name] ~= nil then
- tfm.exec.setNameColor(name, "0x"..namecolor[name])
- end
- end
- alive = alive+1
- end
- function eventPlayerGetCheese(name)
- tfm.exec.setPlayerScore(name,1,true)
- end
- function eventPlayerWon(name)
- place = place+1
- if place == 1 then
- tfm.exec.setPlayerScore(name,5,true)
- elseif place == 2 then
- tfm.exec.setPlayerScore(name,3,true)
- elseif place == 3 then
- tfm.exec.setPlayerScore(name,2,true)
- else
- tfm.exec.setPlayerScore(name,1,true)
- end
- alive = alive-1
- if vanillamodeon == false then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventTextAreaCallback(ID, name, callback)
- if callback=="shaman" then
- tfm.exec.setShaman(name)
- end
- if callback=="changemap" then
- ui.addPopup(65, 2, "Enter Map Code:", name, 300, 200, 200, true)
- end
- if callback=="close" then
- ui.removeTextArea(87, name) ui.removeTextArea(45, name) ui.removeTextArea(85, name) ui.removeTextArea(6, name) ui.removeTextArea(7, name) ui.removeTextArea(8, name) ui.removeTextArea(9, name) ui.removeTextArea(786, name) ui.removeTextArea(123, name) ui.removeTextArea(124, name) ui.removeTextArea(125, name) ui.removeTextArea(126, name) ui.removeTextArea(1, name) ui.removeTextArea(2, name) ui.removeTextArea(3, name) ui.removeTextArea(4, name) ui.removeTextArea(5, name) ui.removeTextArea(6, name) ui.removeTextArea(127, name) ui.removeTextArea(128, name) ui.removeTextArea(129, name)
- end
- if callback=="teleport" then
- for name, player in pairs(tfm.get.room.playerList) do
- system.bindMouse(name, true)
- end
- if teleporton == true then
- teleporton = false
- if isBanned(name) ~= true then
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- else
- if teleandflylock == false then
- teleporton = true
- if isBanned(name) ~= true then
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><a:hover><b>"..text.teleport.."</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- end
- elseif callback=="color" then
- ui.addPopup(67, 2, "Enter Hex Color Code:\n\nWarning: Colored Name will reset\nupon death.", name, 300, 200, 200, true)
- elseif callback=="resetmap" then
- -- tfm.exec.newGame()
- tfm.exec.newGame(4445759)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- gravity = 1
- print(name.." reset the map.")
- elseif callback=="time" then
- print(name.." activated infinite map time.")
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.setGameTime(0)
- elseif callback=="fly" then
- if flyon == true then
- flyon = false
- for name, player in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(name, 32, true, false)
- end
- if isBanned(name) ~= true then
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- else
- if teleandflylock == false then
- flyon = true
- for name, player in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(name, 32, true, true)
- end
- if isBanned(name) ~= true then
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><a:hover><b>"..text.fly.."</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- end
- elseif callback=="meep" then
- tfm.exec.giveMeep(name)
- elseif callback=="path" then
- if pathon == true then
- pathon = false
- holding = false
- tfm.exec.bindKeyboard(name, 32, true, false)
- tfm.exec.bindKeyboard(name, 32, false, false)
- ui.addTextArea(125, ""..name.." toggled<V> Paths<N> off! <p align='right'><R><a href='event:close'>X</a></p>", playerList, 20, 220, 250, 20, 0x000001, 0x000001, 1, true)
- else
- flyon = false
- pathon = true
- holding = false
- tfm.exec.bindKeyboard(name, 32, true, true)
- tfm.exec.bindKeyboard(name, 32, false, true)
- ui.addTextArea(125, ""..name.." toggled<V> Paths<N> on! <p align='right'><R><a href='event:close'>X</a></p>", playerList, 20, 220, 250, 20, 0x000001, 0x000001, 1, true)
- end
- elseif callback=="snowball" and snowballlock==false then
- if snowon == true then
- snowon = false
- teleandflylock = false
- if isBanned(name) ~= true then
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(111, playerList)
- ui.addTextArea(111, "<a href='event:snowball'><N2>"..text.snowball.."</a>", playerList, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- else
- snowon = true
- teleandflylock = true
- if isBanned(name) ~= true then
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>̶T̶o̶g̶g̶l̶e̶ ̶T̶e̶l̶e̶p̶o̶r̶t̶a̶t̶i̶o̶n̶</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>T̶o̶g̶g̶l̶e̶ ̶F̶l̶i̶g̶h̶t̶</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- if teleporton == true then
- teleporton = false
- end
- if flyon == true then
- flyon = false
- end
- if isBanned(name) ~= true then
- ui.removeTextArea(111, playerList)
- ui.addTextArea(111, "<a href='event:snowball'><a:hover><B>"..text.snowball.."</a>", playerList, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- elseif callback=="heart" then
- if hearton == true then
- hearton = false
- print(name.." deactivated heart clicks.")
- else
- hearton = true
- system.bindMouse (name, true)
- print(name.." activated heart clicks.")
- end
- elseif callback=="gravity" then
- print(name.." activated no gravity.")
- gravity = 0
- tfm.exec.newGame(xml)
- elseif callback:sub(1, 6)=='amenu0' then
- players[name].aMenu.target=callback:sub(7)
- ui.removeTextArea(1, name)
- ui.addTextArea(2, aMenu.text:format(callback:sub(7)), name, 10, 20, nil, nil, 1, 0, 0.7, true)
- elseif callback:sub(1, 6)=='amenup' then
- local aID, pID=tonumber(callback:sub(7)), players[name].aMenu.pID
- if type(aMenu.actions[pID])=='table' and aMenu.actions[pID][3] then
- for i=1, #aMenu.actions[pID][3] do
- ui.addPopup(i, 0, '', name, 9e5, 9e5, 1, true)
- end
- end
- if pID==aID then
- players[name].aMenu.pID=0
- else
- if type(aMenu.actions[aID])=='table' and aMenu.actions[aID][3] then
- if not players[name].aMenu.params[aID] then
- players[name].aMenu.params[aID]=aMenu.actions[aID][4] and table.copy(aMenu.actions[aID][4]) or {}
- end
- players[name].aMenu.pID=aID
- for i=1, #aMenu.actions[aID][3] do
- showParamPopup(name, i, aMenu.actions[aID][3][i], players[name].aMenu.params[aID][i])
- end
- end
- end
- elseif callback:sub(1, 5)=='amenu' then
- local aID=tonumber(callback:sub(6))
- if type(aMenu.actions[aID])=='table' then
- if aID>aMenu.nickID then
- callPlayerFunction(players[name].aMenu.target, aMenu.actions[aID][2], unpack(players[name].aMenu.params[aID] or aMenu.actions[aID][4] or {}))
- else
- aMenu.actions[aID][2](unpack(players[name].aMenu.params[aID] or aMenu.actions[aID][4] or {}))
- end
- end
- elseif callback=="admin" then
- eventTextAreaCallback(1, name, 'amenu0*')
- elseif callback=="vanillamode" then
- if vanillamodeon == true then
- vanillamodeon = false
- teleandflylock = false
- snowballlock = false
- tfm.exec.disableAutoNewGame(false)
- if isBanned(name) ~= true then
- ui.removeTextArea(111, playerList)
- ui.addTextArea(111, "<a href='event:snowball'><N2>"..text.snowball.."</a>", playerList, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(112, playerList)
- ui.addTextArea(112, "<a href='event:vanillamodevote'><N2>"..text.vanillamode.."</a>", playerList, -200, 100, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- else
- vanillamodeon = true
- teleandflylock = true
- snowballlock = true
- tfm.exec.disableAutoNewGame(true)
- if isBanned(name) ~= true then
- ui.removeTextArea(111, playerList)
- ui.addTextArea(111, "<a href='event:snowball'><N2>S̶u̶p̶e̶r̶ ̶S̶n̶o̶w̶b̶a̶l̶l̶</a>", playerList, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>̶T̶o̶g̶g̶l̶e̶ ̶T̶e̶l̶e̶p̶o̶r̶t̶a̶t̶i̶o̶n̶</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>T̶o̶g̶g̶l̶e̶ ̶F̶l̶i̶g̶h̶t̶</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(112, playerList)
- ui.addTextArea(112, "<a href='event:vanillamodevote'><a:hover><B>"..text.vanillamode.."</a>", playerList, -200, 100, 150, 20, 0x465A6E, 0x324650, 1, true)
- nextRound()
- end
- end
- elseif callback=="vanillamodevote" then
- vanillamodevote = 0
- ui.addPopup(42, 1, "Vote to toggle Sham Practice Mode?", playerList, 10, 320, 180, true)
- elseif callback=="joinqueue" then
- canQueue = true
- for trash in pairs(vqueue) do
- if vqueue[trash] == name then
- canQueue = false
- break
- end
- end
- if canQueue then
- table.insert(vqueue, name)
- ui.removeTextArea(300, name)
- ui.addTextArea(300, "<a href='event:joinqueue'><N2>"..text.joinqueue.."</a>", name, 850, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(301, name)
- ui.addTextArea(301, "<a href='event:leavequeue'><a:hover><B>"..text.leavequeue.."</a>", name, 850, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(302, playerList)
- updateVQueueText()
- ui.addTextArea(302, "<B>"..text.vqueuetitle.."</B>"..text.vqueuetext, playerList, 850, 130, 150, 200, 0x465A6E, 0x324650, 1, true)
- invqueue = true
- else
- ui.addPopup(1338, 0, "You are already on the queue list!", name, 200, 150, 200, true)
- end
- elseif callback=="leavequeue" then
- canRemove = false
- for trash in pairs(vqueue) do
- if vqueue[trash] == name then
- canRemove = true
- table.remove(vqueue, trash)
- break
- end
- end
- if canRemove then
- ui.removeTextArea(300, name)
- ui.addTextArea(300, "<a href='event:joinqueue'><B>"..text.joinqueue.."</a>", name, 850, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(301, name)
- ui.addTextArea(301, "<a href='event:leavequeue'><N2>"..text.leavequeue.."</a>", name, 850, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(302, playerList)
- updateVQueueText()
- ui.addTextArea(302, "<B>"..text.vqueuetitle.."</B>"..text.vqueuetext, playerList, 850, 130, 150, 200, 0x465A6E, 0x324650, 1, true)
- invqueue = false
- else
- ui.addPopup(1338, 0, "You can't remove nothing, your brain should know this.", name, 200, 150, 200, true)
- end
- elseif callback=="toggleui" then
- if uiToggled == true then
- ui.addTextArea(104, "<a href='event:shaman'><B>"..text.shaman.."</a>", name, -200, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(105, "<a href='event:changemap'><B>"..text.changemap.."</a>", name, -200, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- if vanillamodeon == true then
- ui.addTextArea(112, "<a href='event:vanillamodevote'><a:hover><B>"..text.vanillamode.."</a>", name, -200, 100, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- ui.addTextArea(112, "<a href='event:vanillamode'><N2>"..text.vanillamode.."</a>", name, -200, 100, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- if teleporton == true then
- ui.addTextArea(106, "<a href='event:teleport'><a:hover><b>"..text.teleport.."</a>", name, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- if teleandflylock == true then
- ui.addTextArea(106, "<a href='event:teleport'><N2>̶T̶o̶g̶g̶l̶e̶ ̶T̶e̶l̶e̶p̶o̶r̶t̶a̶t̶i̶o̶n̶</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", name, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- if flyon == true then
- ui.addTextArea(107, "<a href='event:fly'><a:hover><b>"..text.fly.."</a>", name, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- if teleandflylock == true then
- ui.addTextArea(107, "<a href='event:fly'><N2>T̶o̶g̶g̶l̶e̶ ̶F̶l̶i̶g̶h̶t̶</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", name, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- ui.addTextArea(108, "<a href='event:meep'><B>"..text.meep.."</a>", name, -200, 190, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(109, "<a href='event:color'><B>"..text.color.."</a>", name, -200, 220, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(110, "<a href='event:close'><N2>"..text.path.."</a>", name, -200, 250, 150, 20, 0x465A6E, 0x324650, 1, true)
- if snowon == true then
- ui.addTextArea(111, "<a href='event:snowball'><a:hover><B>"..text.snowball.."</a>", playerList, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- ui.addTextArea(111, "<a href='event:snowball'><N2>"..text.snowball.."</a>", name, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- if invqueue == true then
- ui.addTextArea(300, "<a href='event:joinqueue'><N2>"..text.joinqueue.."</a>", name, 850, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(301, "<a href='event:leavequeue'><a:hover><B>"..text.leavequeue.."</a>", name, 850, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- else
- ui.addTextArea(300, "<a href='event:joinqueue'><B>"..text.joinqueue.."</a>", name, 850, 40, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(301, "<a href='event:leavequeue'><N2>"..text.leavequeue.."</a>", name, 850, 70, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- updateVQueueText()
- ui.addTextArea(302, "<B>"..text.vqueuetitle.."</B>"..text.vqueuetext, name, 850, 130, 150, 200, 0x465A6E, 0x324650, 1, true)
- ui.addTextArea(400, "<a href='event:toggleui'><B>"..text.toggleui.."</a>", name, 850, 575, 150, 20, 0x000001, 0x000001, 1, true)
- uiToggled = false
- ui.removeTextArea(400, name)
- ui.addTextArea(400, "<a href='event:toggleui'><B>"..text.toggleui.."</a>", name, 850, 575, 150, 20, 0x000001, 0x000001, 1, true)
- else
- ui.removeTextArea(104, name)
- ui.removeTextArea(105, name)
- ui.removeTextArea(106, name)
- ui.removeTextArea(107, name)
- ui.removeTextArea(108, name)
- ui.removeTextArea(109, name)
- ui.removeTextArea(110, name)
- ui.removeTextArea(111, name)
- ui.removeTextArea(112, name)
- ui.removeTextArea(300, name)
- ui.removeTextArea(301, name)
- ui.removeTextArea(302, name)
- uiToggled = true
- ui.removeTextArea(400, name)
- ui.addTextArea(400, "<a href='event:toggleui'><a:hover><B>"..text.toggleui.."</a>", name, 850, 575, 150, 20, 0x000001, 0x000001, 1, true)
- end
- end
- end
- function eventKeyboard(name, key, down, x, y)
- players[name].keys[key]=down
- if flyon == true then
- if key==32 then
- tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
- end
- end
- if pathon==true then
- if key==32 then
- if down then
- holding[name] = true
- else
- holding[name] = false
- end
- end
- end
- if key==107 then
- mousex = tfm.get.room.playerList[name].x
- mousey = tfm.get.room.playerList[name].y
- print("X:"..mousex.." Y:"..mousey)
- end
- end
- function eventMouse(name, x, y, mousex, mousey)
- if players[name].keys[16] and isAdmin(name) then
- local pList={}
- for n, p in pairs(tfm.get.room.playerList) do
- if math.abs(p.x-x)<25 and math.abs(p.y-y)<25 then
- table.insert(pList, n)
- end
- end
- if #pList>1 then
- local s='<R><a href="event:close"><b>Close</b></a><V>'
- for i=1, #pList do
- s=s..string.format('\n<a href="event:amenu0%s">%s</a>', pList[i], pList[i])
- end
- local maxy=380-(14*(#pList+1))
- local y=y>maxy and maxy or y
- ui.addTextArea(1, s, name, x, y, nil, nil, 1, 0, 0.7)
- elseif #pList==1 then
- eventTextAreaCallback(1, name, 'amenu0'..pList[1])
- end
- end
- if players[name].keys[17] and isAdmin(name) then
- local pList={}
- for n, p in pairs(tfm.get.room.playerList) do
- if math.abs(p.x-x)<4500 and math.abs(p.y-y)<4500 then
- table.insert(pList, n)
- end
- end
- if #pList>1 then
- local s='<R><a href="event:close"><b>Close</b></a><V>'
- for i=1, #pList do
- s=s..string.format('\n<a href="event:amenu0%s">%s</a>', pList[i], pList[i])
- end
- local maxy=380-(14*(#pList+1))
- local y=y>maxy and maxy or y
- ui.addTextArea(1, s, name, x, y, nil, nil, 1, 0, 0.7)
- elseif #pList==1 then
- eventTextAreaCallback(1, name, 'amenu0'..pList[1])
- end
- end
- if teleporton == true then
- mousex = tfm.get.room.playerList[name].x
- mousey = tfm.get.room.playerList[name].y
- tfm.exec.movePlayer(name, x, y, false, 0, 1, false)
- tfm.exec.displayParticle(36, mousex, mousey, 0, -20, 0, 0, nil)
- tfm.exec.movePlayer(name, x, y, false, 0, 1, false)
- y = y-160
- tfm.exec.displayParticle(36, x, y, 0, 20, 0, 0, nil)
- y = y+160
- end
- if teleporton == nil then
- teleporton = false
- end
- if hearton == true then
- local size = 5;
- local x_position = x;
- local y_position = y;
- for t=0, 2*math.pi, 0.1 do
- x=(16*math.sin(t)^3)*size + x_position
- y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*size
- y=-y + y_position
- tfm.exec.addShamanObject(0, x, y);
- end
- if hearton == nil then
- hearton = false
- end
- else
- end
- end
- function eventLoop(time, remainingtime, name, x, y)
- if snowon == true and snowballlock == false then
- tfm.exec.snow(1, 100)
- end
- if vanillamodeon == true then
- if alive <= 0 or remainingtime <= 1000 then
- nextRound();
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.disableAutoShaman(false)
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- if player.isShaman then
- for name in pairs(namecolor) do
- if namecolor[name] ~= nil then
- tfm.exec.setNameColor(name, "0x"..namecolor[name])
- end
- end
- end
- end
- if vanillamodeon==true and mapcode~=4445759 then
- if teleporton==true then
- tfm.exec.newGame(4445759)
- teleporton = false
- if isBanned(name) ~= true then
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- if flyon==true then
- tfm.exec.newGame(4445759)
- flyon = false
- for name, player in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(name, 32, true, false)
- end
- if isBanned(name) ~= true then
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- if snowon==true then
- tfm.exec.newGame(4445759)
- snowon = false
- teleandflylock = false
- if isBanned(name) ~= true then
- ui.removeTextArea(106, playerList)
- ui.addTextArea(106, "<a href='event:teleport'><N2>"..text.teleport.."</a>", playerList, -200, 130, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(107, playerList)
- ui.addTextArea(107, "<a href='event:fly'><N2>"..text.fly.."</a>", playerList, -200, 160, 150, 20, 0x465A6E, 0x324650, 1, true)
- ui.removeTextArea(111, playerList)
- ui.addTextArea(111, "<a href='event:snowball'><N2>"..text.snowball.."</a>", playerList, -200, 280, 150, 20, 0x465A6E, 0x324650, 1, true)
- end
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- if player.playerName == "Umielyon" then
- umielyonx = player.x
- umielyony = player.y
- end
- if player.playerName == "Cgtmouse" then
- cgtmousex = player.x
- cgtmousey = player.y
- end
- if player.playerName == "Kageroutea" then
- kagerouteax = player.x
- kagerouteay = player.y
- end
- end
- if pathon == true then
- for name,player in pairs(tfm.get.room.playerList) do
- if holding[name] == true then
- tfm.exec.addConjuration(player.x/10, player.y/10+2, 10000)
- end
- end
- end
- end
- function nextRound()
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.newGame(maps[math.random(#maps)]);
- end
- function eventNewGame()
- for name,player in pairs(tfm.get.room.playerList) do
- if player.isShaman then
- tfm.exec.setPlayerScore(name,0,false)
- end
- end
- totalplayers = 0
- for name,player in pairs(tfm.get.room.playerList) do
- totalplayers = totalplayers+1
- end
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- alive = 0
- place = 0
- for name, player in pairs(tfm.get.room.playerList) do
- alive = alive+1
- end
- mapcode = tfm.get.room.currentMap
- if mapcode == "@4445759" then
- tfm.exec.setUIMapName("<VP>Cloud Strife - House")
- else
- tfm.exec.setUIMapName("<VP>Cloud Strife - Map "..mapcode)
- tfm.exec.disableAutoShaman(false)
- end
- if gravity == 0 then
- xml = tfm.get.room.xmlMapInfo.xml:gsub("<P ", "<P G=\"0, 0\"")
- else
- end
- -- if vanillamodeon == true then
- -- xml = tfm.get.room.xmlMapInfo.xml:gsub("<P /><Z><S /><D><P ", "<P G=\"0,0\" /><Z><S /><D><P X=\"400\" P=\"1,0\" C=\"fdfdfd\" Y=\"209\" T=\"89\"")
- -- end
- end
- function eventPopupAnswer(ID, name, answer)
- local aID=players[name].aMenu.pID
- if ID == 42 then
- if answer == "yes" then
- vanillamodevote = vanillamodevote+1
- if vanillamodevote >= (totalplayers/2)+(totalplayers/4) then
- ui.addPopup(42, 0, "Vote succeeded.", playerList, 10, 320, 180, true)
- vanillamodevote = 0
- eventTextAreaCallback(42, name, vanillamode)
- end
- end
- elseif aMenu.actions[aID] and aMenu.actions[aID][3] and ID>=1 and ID<=#aMenu.actions[aID][3] then
- if answer=='' then
- players[name].aMenu.params[aID][ID]=nil
- else
- players[name].aMenu.params[aID][ID]=answer
- end
- showParamPopup(name, ID, aMenu.actions[aID][3][ID], players[name].aMenu.params[aID][ID])
- elseif ID == 65 then
- if answer == "" then
- else
- tfm.exec.newGame(answer)
- ui.addTextArea(786, "<V>"..name.." <N>"..text.changemapattempt.." <p align='right'><R><a href='event:close'>X</a></p>", playerList, 400, 500, 300, 20, 1, true, true)
- flyon = false
- teleporton = false
- end
- elseif ID == 67 then
- if answer == "" then
- else
- tfm.exec.setNameColor(name, "0x" .. answer)
- namecolor[name] = answer
- end
- end
- end
- function showParamPopup(name, i, key, val)
- ui.addPopup(i, 2, string.format('<p align="center"><b>%s:</b> %s', key, tostring(val or '')), name, 170+(((i-1)%6)*105), (math.floor((i-1)/6)*75)+20, 100, true)
- end
- function eventEmotePlayed(emoteName, emote)
- if emote == 3 then
- for name,player in pairs(tfm.get.room.playerList) do
- if player.x<=umielyonx+5 or player.x<=cgtmousex+5 or player.x<=kagerouteax+5 then
- if player.x>=umielyonx-5 or player.x>=cgtmousex-5 or player.x>=kagerouteax-5 then
- if player.y<=umielyonry+5 or player.y<=cgtmousey+5 or player.x<=kagerouteay+5 then
- if player.y>=umielyony-5 or player.y>=cgtmousey-5 or player.y>=kagerouteay-5 then
- if emoteName == name then
- tfm.exec.giveCheese(emoteName)
- end
- end
- end
- end
- end
- end
- end
- end
- function callPlayerFunction(name, func, ...)
- if name=='*' then
- for n in pairs(tfm.get.room.playerList) do
- func(n, ...)
- end
- else
- func(name, ...)
- end
- end
- function eventChatCommand(name, cmd)
- local cmd_args = {}
- for arg in cmd:gmatch("[^%s]+") do
- table.insert(cmd_args, arg)
- end
- if cmd=='shaman' or cmd=='sham' then
- tfm.exec.setShaman(name)
- end
- if cmd=='avampire' or cmd=='avamp' then
- tfm.exec.setVampirePlayer(name)
- end
- if cmd_args[1] == "color" then
- if cmd_args[2] == '' then
- eventNewPlayer(name)
- else
- tfm.exec.setNameColor(name, "0x"..cmd_args[2])
- namecolor[name] = cmd_args[2]
- end
- end
- if cmd=='totalplayers' then
- print(totalplayers)
- end
- if cmd=='totalvotes' then
- print(vanillamodevote)
- end
- if cmd=='meep' then
- tfm.exec.giveMeep(name)
- end
- if isAdmin(name) then
- if cmd=='amenu' then
- eventTextAreaCallback(1, name, 'amenu0'..name)
- elseif cmd:sub(1, 6)=='amenu ' then
- eventTextAreaCallback(1, name, 'amenu0'..cmd:sub(7))
- end
- end
- end
- command = {handlers = {}}
- function command.addHandler(text, handler)
- if command.handlers[text] == nil then
- command.handlers[text] = {}
- end
- table.insert(command.handlers[text], handler)
- end
- function command.removeHandler(text, handler)
- if command.handlers[text] ~= nil then
- local index
- for i, h in ipairs(command.handlers[text]) do
- if handler == h then
- index = i
- end
- end
- if index ~= nil then
- table.remove(command.handlers[text], index)
- if #command.handlers[text] == 0 then
- command.handlers[text] = nil
- end
- end
- end
- end
- function command.handle(text, player, args)
- if command.handlers[text] ~= nil then
- for i, handler in ipairs(command.handlers[text]) do
- handler(player, unpack(args))
- end
- end
- end
- function string.split(str, s)
- local res = {};
- for part in string.gmatch(str, "[^" .. s .. "]+") do
- table.insert(res, part)
- end
- return res;
- end
- function yasayanFareSayisi()
- local i=0
- for _, oyuncu in pairs(tfm.get.room.playerList) do
- if not oyuncu.isDead then
- i=i+1
- end
- end
- return i
- end
- function unpack (t, i)
- i = i or 1
- local v = t[i]
- if v ~= nil or #t > i then return v, unpack(t, i+1) end
- end
- function table.copy(t, d)
- d = d or false
- local rt = {}
- for k, v in pairs(t) do
- if d then
- if type(k) == "table" then
- k = table.copy(k, true)
- end
- if type(v) == "table" then
- v = table.copy(v, true)
- end
- end
- rt[k] = v
- end
- return rt
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement