Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Commands list:
- 1. !ms [MSG] = Send a message as a funcorp member.
- 2. !start = starts the game!
- 3. !stop = stops the game!
- 4. !g = will switch the ground(if current ground is lava , then it will switch it to dirt same with dirt to lava)!
- 5. !tp all = turn on the tp power(See Other powers list to know how to use it)!
- 6. !anvilgod = show anvilgod!
- Other powers:
- 1. If tp power is on , then Mouse click anywhere in the map to teleport everyone aswell as you to the mouse position!
- 2. Hold Shift+Mouse click = spawn random objects in your mouse position!
- 3. Admins only can use the imagelist
- ]]
- imgList = {
- {"Return To Mouse", "153d331c6b9", 50, 48},
- {"Dora Mouse", "1740e70c6cc", 27, 45, "1740e704f7c",27, 45},
- {"Stripper Horse", "165df07c053", 36, 70, "165df038d30", 36, 70},
- {"Mouse with broom", "155c9fa9ef2", 40, 60, "155c9fab3f1",40, 60},
- {"Meli Mask", "1670d6b8629", 40, 55, "1670d6c6973", 40, 55},
- {"Mouse Feels", "16760a89ce2", 27, 45, "16760a8be17",27, 45},
- {"Mouse Pika", "16760bc8d92", 27, 45, "16760bcabfb", 27,45},
- {"Zalekha", "16f723031cb", 25, 30, "16f6d89a920", 25, 30};
- {"Poop", "155c4a31e48",25, 30},
- {"Toilet", "1507c256bcc", 23, 41, "1507c258fe8", 23, 41},
- {"Dora", "155c4d1de05", 25, 45, "155c4d1f100", 25, 45},
- {"Makka Pakka", "1746b07f701", 30, 60, "1746b0a835c", 30, 60},
- {"Upsy Daisy", "1746b08317b", 30, 65, "1746b095bca", 30, 65},
- {"Derp dove", "172e1ca9b44", 35, 40, "172e1ca6f30", 55, 40},
- {"Spiderman", "168a994a147", 50, 61, "168a994c06f", 50, 61},
- {"Spiderman2","168aa026d06", 50, 144, "168aa024cca", 50, 144},
- {"Spiderman3","168aa03190a", 65, 71, "168aa033d46", 65, 71},
- {"Spiderman4", "168aa029248", 50, 147, "168aa02b44d", 50, 147},
- {"Spongebob1","155c49750bd", 30, 38, "155c4976244", 30, 38},
- {"Spongebob2","174da18560a", 30, 45, "174da17dbbe", 30, 45},
- {"Wild Spongebob","155c4aac0b4", 20, 36, "155c4aadc1c", 20, 36},
- {"Jerry", "171524a755e", 40, 42,"1740c7d4de6", 40, 42},
- {"Jerry2", "1740c7a6f61", 38, 35,"171524ab085", 38, 35},
- {"Jerry3","1717581267e", 35, 80,"1717581457e",35, 80},
- {"Jerry4","174d12f563b", 35, 60,"174d12f1634",35, 60},
- {"Jerry5","174d140642c", 40, 70,"174d14019e2",40, 70},
- {"Jerry Yaaa!","1718e694e82", 32, 90,"1718e698ac9",42, 90},
- {"Nibbles", "174d163217a",20, 33,"174d165c0fc",20, 33},
- {"Tom1", "174da253891", 20, 52, "174da244df6", 30, 52},
- {"Tom2","1718e3f183d", 40, 65,"1718e3f4491", 30, 65},
- {"Annoying Orange", "155ca0f4af3", 25, 30, "155ca0f5ca7", 25, 30},
- {"Smudge The Cat","1740c8e68af", 45, 65,"1740c8f0857", 45, 65},
- {"Yelling Girl","1740c8ac500", 60, 65,"1740c8a4791", 30, 65},
- {"Shawarma", "155c4b131dc",30, 35,"155c4b14458",30, 35},
- {"HIS NAME IS JOHN CENA", "1556848a816", 20, 35},
- {"Tigrounette", "1557c2e6143", 27, 50},
- {"Melibellule", "165968be277", 35, 55},
- {"Meli 1", "1507b11647d", 40, 50},
- {"Meli 2", "1507b1175bb", 40, 50},
- {"Meli 3", "1507b11865a", 40, 50},
- {"Meli 4", "1740cbdc8ed", 40,60 ,"1507b1196d0", 40, 60},
- {"Cardi B", "175049583f9", 40,40 ,"1750495fec9", 40, 40},
- {"Cardi B 2", "17504a03bff", 25,65 ,"17504a0c32d", 35, 65},
- {"Meme boy1","174db462997", 36, 60},
- {"Meme boy2","174db466907", 36, 60},
- {"Meow", "168a08101ee", 45, 114, "168a080e0c2", 45, 114},
- {"Meow", "168be2c2308", 50,115, "168be2b7832", 50, 115},
- {"Nee CAT!", "168ebed1afb", 50, 111, "168ebed365e", 50,111},
- {"Nyan CAT!","168be3786ce", 60, 29,"168be37ab13", 60, 29},
- {"Mr.Bean", "168a9a39885", 40, 137, "168a9a3b89f", 40, 137},
- {"Mr.Bean2","168a9a3f843", 57, 152, "168a9a3d80f", 57, 152},
- {"Huuh??", "168b443ea6c", 50, 88,"168b443cc09", 50, 88},
- {"Baldi","1740d1f4816", 20, 75},
- {"Bush","1714bb4b8b1", 34, 21},
- {"wat?","168be2e46a2", 55, 79, "168be2d9a28", 55, 79},
- {"Fox : Huh?","168a9914efe", 50, 138, "168a9912f23", 65,138},
- {"Fat Bugs Bunny", "16a1132c123",40, 116,"16a1132a8d5", 40, 116},
- {"Fat Sonic", "168a080bc7f", 50, 63, "168a0809dae", 50, 63},
- {"Shrek!", "168a9933057", 50, 87,"168a993157e", 50, 87},
- {"Harold Doctor","168a03691f5", 40, 95, "168a0366e69", 40, 95},
- {"Illuminati", "1689fca843e", 50, 70, "1689fca5c2c", 50, 70},
- {"Yee", "1740e52b581", 20, 60, "1740e54207d", 20, 60},
- {"SadCat", "16f7265452d", 50, 75, "16f72691537", 50, 75},
- {"Otah Mshmoshea", "1718e59096d", 50, 70, "1718e593562", 50, 70},
- {"Pennywise (IT)", "170acc07423", 37, 65, "170acc048de", 37, 65},
- {"Jackie chan", "168be33dd35", 60, 52, "168be33feae", 60, 52},
- {"Psyduck", "1740e503949",15, 40,"1740e53a0be",15, 40},
- {"Patrick", "1740e53347e",25, 55,"1740e4fca1d",25, 55},
- {"Pink Cat", "153ec4eef26", 23, 30, "153ec4ec77d", 26, 30},
- {"Black Cat", "1740d7e5fa2", 23, 50,"1740d8448b9", 23, 50},
- {"Batman", "174da12a81b", 35, 55,"174da122df6", 35, 55},
- {"Cute Groot", "1740d7ea145", 23, 57},
- {"Cute Turtle", "1740d7e24fb", 23, 50},
- {"Nekoburger", "153ec7e82d6", 23, 26, "153ec7e664b", 26, 26},
- {"Tabby", "154c592261e", 30, 32, "154c5925a15", 27, 32},
- {"Squirrel", "156d73b5b13", 21, 24, "156d738d5b1", 20, 24},
- {"Peppa Pig", "155777ce1ab", 45, 55, "155777cc660", 45, 55},
- {"Waddles", "155c51325da", 25, 30, "155c5133917", 25, 30},
- {"Ariana Grande", "1740d11d767", 45, 80, "1740d1246e7", 45, 80},
- {"The Angel Ariana Grande", "1740d18a86d",32, 45, "1740d190eec", 32, 45},
- {"Amoung Us Red", "174d9e1a5cc",20, 30, "174d9e0072e",20, 30},
- {"Amoung Us Cyan", "174d9e43cac",20, 30, "174d9e01e9e",20, 30},
- {"Amoung Us Blue", "174d9e4541d",20, 30, "174d9e03612",20, 30},
- {"Amoung Us Purlple", "174d9e4e0c5",20, 30, "174d9e0c2be",20, 30},
- {"Amoung Us Green", "174d9e46b8f",20, 30, "174d9e04d84",20, 30},
- {"Amoung Us Pink", "174d9e482ff",20, 30, "174d9e064f6",20, 30},
- {"Amoung Us Yellow", "174d9e49a71",20, 30, "174d9e07c67",20, 30},
- {"Amoung Us Black", "174d9e4b1e2",20, 30, "174d9e093d9",20, 30},
- {"Amoung Us White", "174d9e4c974",20, 30, "174d9e0ab49",20, 30},
- {"Mini White Crewmate", "174da0228c6",10, 15, "174da01d1ae",10, 15},
- }
- menuPages = math.ceil(#imgList/6)
- keys = {0,2}
- _left = 0
- _right = 2
- memesMenu = true
- imgData = {}
- facingLeft = {}
- imgId = {}
- mice = {}
- anvilgod={}
- lava={}
- anvilgodImg = {"1736c5e3efe.png","1736c86888e.png"}
- backgrounds = {"173cf0990b3.png","173cf03fa86.png","173cf0392da.png","17372d45dca.jpg","17372d3d135.png","1736d136ca9.png","1736d34a204.png","17369683742.jpg","173695d6d70.jpg","17369524d79.jpg","17369524d79.jpg","1736951e776.jpg","17305a13915.png","172fd0940c4.png","172fd0847d7.png","1712c2e573f.png","1711ecc824b.jpg","1711e9a5172.jpg","1711e9a072a.jpg","1711e8ce5f7.jpg","1711e8ca452.jpg","1711e8c0569.jpg","165245b5238.jpg","1700112d165.jpg","17001097f5a.jpg","170013d6683.jpg"}
- game = {
- admins = {"Noooooooorr#0000","Kiwi_is_here#0558","Massi#0010","Lalajb#0000","Uvfn#0000"},
- time = 8,
- started = false,
- currentGround = "dirt",
- dirtTimer = nil,
- lavaTimer = nil,
- dirtCD = 3000,
- lavaCD = 10000,
- tArea = 10,
- objects = {1,2,3,4,6,7,10,39,59,60,62,68},
- maps = {"6121962","6121962"},
- objectsList = {},
- ground = {}
- };
- players = {}
- local looper = 0
- local reapet = truelocal
- tpAll = false
- local sObjects = false
- game.ground.lava = {type = 3,x = 800,y = 387,r = 0.2,f = 0.3,w = 1600,h = 37,gc = true,mc = false}
- game.ground.dirt = {type = 6,x = 800,y = 387,r = 0.2,f = 0.3,w = 1600,h = 37,gc = true,mc = true}
- translation = {
- en = {welcome="Welcome to FunCorp! Beware! THE FLOOR IS LAVA!!!",
- floorislava="THE FLOOR IS LAVA!",
- win="%s has won the game",
- anvil_here="Anvilgod is here!",
- anvil_nothere="Anvilgod isn't here anymore!"},
- ar = {welcome="!أهلا بكم في الفانكورب! لقد تحولت الأرض الى حمم بركانية،كن حذرا",
- floorislava="!الأرض أصبحت حمم بركانية",
- win="!في الجولة %s فاز",
- anvil_here="!إله السنادين هنا،إحترس",
- anvil_nothere="!لم يعد إله السنادين هنا بعد الآن"},
- ru = {welcome="Добро пожаловать в FunCorp! Осторожно! ПОЛ - ЭТО ЛАВА!!!",
- floorislava="ПОЛ - ЭТО ЛАВА!",
- win="%s выиграл(а) этот раунд.",
- anvil_here="Анвилгод здесь!",
- anvil_nothere="Анвилгод здесь больше нет!"},
- fr = {welcome="Bienvenue sur FunCorp! Attention ! Le sol est en lave!!!",
- floorislava="Le sol est en lave!!!",
- win="%s a gagné la ronde",
- anvil_here="Anvilgod est là!",
- anvil_nothere="Anvilgod n'est plus là!"},
- tr = {welcome="Funcorp'a Hoşgeldiniz! Dikkat! BU ZEMİN LAV!",
- floorislava="BU ZEMİN LAV!",
- win="%s oyunu kazandı.",
- anvil_here="Anvilgod burada!",
- anvil_nothere="Anvilgod artık burada değil!"},
- }
- function tran(n, id)
- if translation[tfm.get.room.playerList[n].community] then
- return translation[tfm.get.room.playerList[n].community][id]
- else
- return translation["en"][id]
- end
- end
- function main()
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- system.disableChatCommandDisplay(nil,true)
- tfm.exec.disablePhysicalConsumables(true)
- changeMap()
- table.foreach(
- tfm.get.room.playerList,
- function(name)
- eventNewPlayer(name)
- end
- )
- end
- function changeMap()
- tfm.exec.newGame(game.maps[math.random(1,#game.maps)])
- end
- local setScore = function(name) tfm.exec.setPlayerScore(name, players[name].score, false) end
- local refreshTimers = function(ground) if ground == "dirt" then game.dirtTimer = 3 elseif ground == "lava" then game.lavaTimer = 10 else game.lavaTimer = 10 game.dirtTimer = 3 end end
- function removeObjects()
- for _,i in next,game.objectsList
- do
- tfm.exec.removeObject(i)
- end
- game.objectsList = {}
- end
- local resetProp = function() game.time = 60 game.tArea = 10 game.objectsList = {} game.currentGround = "dirt" refreshTimers() end
- local removeAreas = function() for _,area in next,{999,2,666} do ui.removeTextArea(area,nil) end end
- function alivePlrCount()
- local c = 0
- for n,p in pairs(tfm.get.room.playerList) do
- if not p.isDead then
- c = c + 1
- end
- end
- return c
- end
- local isAdmin = function(name) for _,n in next,game.admins do if n == name then return true end end return false end
- function spawnObjects(x,y)
- if game.started == true then
- local oC = math.ceil((game.time / 10 > 1 and game.time / 10 or 1))
- local g = false
- local a = nil
- if o == 62 then
- a = 90 g = true
- end
- if x ~= nil and y ~= nil then
- local o = game.objects[math.random(1,#game.objects)]
- if o == 62 then
- a = 90
- g = true
- else
- a = nil
- g = nil
- end
- local sO = tfm.exec.addShamanObject(o, x, y, (a and a or 0),0,0, (g or false)) table.insert(game.objectsList,sO)
- else
- for i=1,oC,1 do
- local o = game.objects[math.random(1,#game.objects)]
- if o == 62 then
- a = 90
- g = true
- else
- a = nil
- g = nil
- end
- local sO = tfm.exec.addShamanObject(o, math.random(100,1500), 360, (a and a or 0),0,0, (g or false)) table.insert(game.objectsList,sO)
- end
- end
- end
- end
- function groundSwitch()
- if game.started == true then
- if game.currentGround == "dirt" then
- local gP = game.ground.lava
- tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
- if not lava then lava = tfm.exec.addImage("173697132e1.png", "!1", 0, 350, nil) end
- if anvil then
- spawnAnvilgod()
- end
- for n, player in next, tfm.get.room.playerList do
- ui.addTextArea(999, "<p align='center'><font size='40' color='#FF0000'>"..tran(n,"floorislava").."</font></p>", n, 140, 125, 520, 119, 0x324650, 0x000000, 0, true)
- end
- if not lava then lava = tfm.exec.addImage("173697132e1.png", "!1", 0, 350, nil) end
- refreshTimers(game.currentGround)
- game.currentGround = "lava"
- elseif game.currentGround == "lava" then
- local gP = game.ground.dirt
- for _,id in next,game.objectsList do
- tfm.exec.removeObject(id)
- end
- removeAnvilgod()
- tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
- if lava then tfm.exec.removeImage(lava) lava = nil end
- refreshTimers(game.currentGround) game.currentGround = "dirt"
- if anvil then
- removeAnvilgod()
- end
- end
- end
- end
- function giveWin(name)
- tfm.exec.giveCheese(name)
- tfm.exec.playerVictory(name)
- players[name].score = players[name].score + 1
- setScore(name)
- end
- function setGround(g)
- if game.started == false then
- game.currentGround = g
- local gP = game.ground[g]
- if not lava then lava = tfm.exec.addImage("173697132e1.png", "!1", 0, 350, nil) end
- tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
- else
- game.currentGround = g
- local gP = game.ground[g]
- if lava then tfm.exec.removeImage(lava) lava = nil end
- tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
- refreshTimers(game.currentGround)
- end
- end
- function eventNewGame()
- removeAnvilgod()
- for n,mouse in pairs(mice) do
- facingLeft[n] = false
- updateImg(n)
- end
- if game.started == true then
- Background = backgrounds[math.random(#backgrounds)]
- tfm.exec.addImage(Background, "_0", 0, 0, n)
- resetProp()
- system.removeTimer(meep)
- meep = nil
- reapet = true
- tfm.exec.setGameTime(game.time, true)
- setGround("dirt")
- meep = system.newTimer(function() table.foreach(tfm.get.room.playerList,function(name) tfm.exec.giveMeep(name) end) end,35000,false)
- else
- resetProp()
- setGround("dirt")
- end
- end
- function eventNewPlayer(name)
- mice[name] = {menuPage = 1}
- for _,k in pairs(keys) do
- tfm.exec.bindKeyboard(name, k, true)
- end
- facingLeft[name] = false
- updateImg(name)
- if memesMenu then
- for _,n in next,game.admins do
- ui.addTextArea(0, "<p align='center'><font color='#010101'><a href='event:openMenu'>CLICK HERE</a></font></p>", n, 714, 380, 82, 16, 0xff5880, 0xff00cc, 0.8, true)
- end
- end
- if Background then tfm.exec.addImage(Background, "_0", 0, 0, name) end
- if players[name] then
- players[name].score = 0
- setScore(name)
- else
- players[name] = {score = 0}
- setScore(name)
- end
- tfm.exec.chatMessage("<font color='#FF7F0F'>"..tran(name,"welcome").."\n",name)
- if isAdmin(name) then
- system.bindMouse(name, true)
- system.bindKeyboard(name, 16, false, true)
- system.bindKeyboard(name, 16, true, true)
- end
- end
- function eventPlayerDied(name)
- if game.started == true then
- if alivePlrCount() <= 1 then
- reapet = false removeAreas()
- for name,p in next,tfm.get.room.playerList do
- if not p.isDead then
- for n, player in next, tfm.get.room.playerList do
- ui.addTextArea(2, "<p align='center'><font size='30' color='#FFFF00'>"..string.format(tran(n,"win"),name).."</font></p>", n, 50, 250, 700, 500, 0x324650, 0x000000, 0, true)
- ui.addTextArea(999, "<p align='center'><font size='50' color='#FF0000'>"..tran(n,"floorislava").." </font></p>", n, 50, 125, 700, 119, 0x324650, 0x000000, 0, true)
- end
- giveWin(name)
- end
- end
- system.newTimer(function() removeAreas() changeMap() end, 5000, false)
- end
- end
- end
- function eventChatCommand(name, command)
- local arg={}
- for argument in command:gmatch('[^%s]+') do
- table.insert(arg,argument)
- end
- if isAdmin(name) == true then
- if arg[1] == "ms" and arg[2] ~= nil then
- local t = command:find('%s')
- local msg = command:sub(t+1)
- tfm.exec.chatMessage("<Fc>• [" ..name .."]:</Fc><CE> " ..msg .."</CE>")
- end
- if arg[1] == "tp" and arg[2] == "all" then
- tfm.exec.chatMessage("<font color='#F95705'>• [FuncorpBot]:</font><bv> You turned ON tp power! <b>Mouse click</b> anywhere on the screen to teleport everyone!</bv>",name)
- tpAll = true
- end
- if arg[1] == "start" then
- if not game.started then
- game.started = true
- changeMap()
- end
- elseif arg[1] == "stop" then
- if game.started == true then
- game.started = false
- removeAreas()
- changeMap()
- end
- elseif arg[1] == "g" then
- removeAreas()
- spawnObjects()
- groundSwitch()
- elseif arg[1] == "anvilgod" then
- if anvil == true then
- anvil = false
- for n, player in next, tfm.get.room.playerList do
- tfm.exec.chatMessage("<font color='#FF7F0F'>"..tran(n,"anvil_nothere").."",n)
- end
- else
- anvil = true
- for n, player in next, tfm.get.room.playerList do
- tfm.exec.chatMessage("<font color='#FF7F0F'>"..tran(n,"anvil_here").."",n)
- end
- end
- end
- end
- end
- function checkAnvilgod()
- if not anvilgodHere then
- spawnAnvilgod()
- else
- removeAnvilgod()
- end
- end
- function spawnAnvilgod()
- anvilgodHere = true
- xAnvigod = math.random(200,1400)
- tfm.exec.explosion(xAnvigod+80,350,-400,300,false)
- tfm.exec.explosion(xAnvigod+80,250,-400,300,false)
- anvilgod = tfm.exec.addImage(anvilgodImg[math.random(#anvilgodImg)],"_3",xAnvigod,30)
- end
- function removeAnvilgod()
- if anvilgodHere then
- anvilgodHere = false
- if anvilgod then tfm.exec.removeImage(anvilgod) anvilgod=nil end
- end
- end
- function
- eventMouse(name, x, y)
- if isAdmin(name) then
- if sObjects == true then
- spawnObjects(x,y)
- end
- if tpAll == true then
- for n,p in pairs(tfm.get.room.playerList) do
- tfm.exec.movePlayer(n,x,y,false,0,0,false)
- end
- tpAll = false
- end
- end
- end
- function eventLoop(cT, tR)
- if game.started == true and reapet == true then
- tR = tR / 1000
- game.time = tR
- looper = looper + 0.5
- if looper == 1 then
- if game.currentGround == "lava" then
- if game.dirtTimer > 0 then
- game.dirtTimer = game.dirtTimer - 1 elseif
- game.dirtTimer <= 0 then
- groundSwitch()
- ui.removeTextArea(999, nil)
- end
- end
- if game.currentGround == "dirt" then
- if game.lavaTimer > 0 then
- if game.lavaTimer == 4 then
- spawnObjects()
- end
- ui.addTextArea(666, "<p align='center'><font color='0xffffff' face='soopafresh'><font size='90'>" ..game.lavaTimer .."</font></p>", nil, 340, 125, 120, 119, 0x324650, 0x000000, 0, true)
- game.lavaTimer = game.lavaTimer - 1
- elseif
- game.lavaTimer <= 0 then
- ui.removeTextArea(666,nil)groundSwitch()
- end
- end
- looper = 0
- end
- end
- end
- function eventKeyboard(name, key, Keydown, x, y)
- if isAdmin(name) then
- if key == 16 then
- if Keydown then
- sObjects = true
- else
- sObjects = false
- end
- end
- end
- if key == _left then
- facingLeft[name] = true
- updateImg(name, true)
- elseif key == _right then
- facingLeft[name] = false
- updateImg(name, true)
- end
- end
- function updateImg(name, turning)
- local d = imgData[name]
- if not d then return end
- if not d[5] then
- if turning then return
- else
- facingLeft[name] = true
- end
- end
- if imgId[name] then tfm.exec.removeImage(imgId[name]) end
- local img,x,y
- if facingLeft[name] then
- img,x,y = d[2],d[3],d[4]
- else
- img,x,y = d[5],d[6],d[7]
- end
- imgId[name] = tfm.exec.addImage(img..".png", "%"..name, -x, -y, nil)
- end
- function eventTextAreaCallback(id, name, cb)
- local mouse = mice[name]
- if id == 0 then
- if mouse.menuOpen then
- mouse.menuOpen = false
- closeMenu(name)
- else
- mouse.menuOpen = true
- openMenu(name)
- end
- elseif id == 2 and mouse.menuPage > 1 then
- mouse.menuPage = mouse.menuPage - 1
- openMenu(name)
- elseif id == 3 and mouse.menuPage < menuPages then
- mouse.menuPage = mouse.menuPage + 1
- openMenu(name)
- elseif id >= 10 and id <= 15 then
- local k = cb:sub(12) + 0
- if k == 1 then
- for name in next, tfm.get.room.playerList do
- imgData[name] = nil
- end
- tfm.exec.killPlayer(name)
- else
- for name in next, tfm.get.room.playerList do
- imgData[name] = imgList[k]
- end
- end
- updateImg(name)
- end
- end
- function openMenu(name)
- ui.addTextArea(1, "", name, 58, 44, 687, 110, 0x324650, 0x0, 0.4, true)
- ui.addTextArea(16, "<p align='center'><font color='#010101' size='32'> < </font></p>", name, 8, 80, 50, 50, 0x324650, 0x0, 0, true)
- ui.addTextArea(17, "<p align='center'><font color='#010101' size='32'> > </font></p>", name, 737, 80, 50, 50, 0x324650, 0x0, 0, true)
- ui.addTextArea(2, "<p align='center'><font size='32'><a href='event:prevPage'> < </a></font></p>", name, 6, 78, 50, 50, 0x324650, 0x0, 0, true)
- ui.addTextArea(3, "<p align='center'><font size='32'><a href='event:nextPage'> > </a></font></p>", name, 735, 78, 50, 50, 0x324650, 0x0, 0, true)
- local mouse = mice[name]
- local page = mouse.menuPage
- local menuImg = mouse.menuImg
- if menuImg then
- for i=1,6 do
- if menuImg[i] then tfm.exec.removeImage(menuImg[i]) end
- ui.removeTextArea(9+i, name)
- end
- else
- mouse.menuImg = {}
- menuImg = mouse.menuImg
- end
- for i=1,6 do
- local id = (page-1)*6 + i
- local data = imgList[id]
- if not data then break end
- local x1 = 63 + 115 * (i-1)
- ui.addTextArea(3+i, "", name, x1, 50, 100, 100, 0x324650, 0x0, 0.1, true)
- ui.addTextArea(9+i, "<p align='center'><a href='event:chooseImage"..id.."'>" .. data[1] .. "</a></p>\"", name, x1, 168, 100, 24, 0x324650, 0x0, 0.6, true)
- menuImg[i] = tfm.exec.addImage(data[2]..".png", "&10000", x1+50 - data[3], 100 - data[4], name)
- end
- end
- function closeMenu(name)
- local menuImg = mice[name].menuImg
- for i=1,6 do
- if menuImg[i] then tfm.exec.removeImage(menuImg[i]) end
- end
- for i=1,17 do
- ui.removeTextArea(i, name)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement