[Unofficial Module] Mouseour |
Czarodziejh « Citoyen » 1659396480000
| 0 | ||
Mouseour is a minigame where you have to spawn objects using your mouse to complete the map. one of the maps Current available commands: !setgametime value - sets game time, needs a maps restart !setstartobjects value - sets the start amount of objects to spawn Contact: discord: Mr. Wydra#2785 Keep in mind that it's a first version counters = {} maps = {"@7912127", "@7912131", "@7912143", "@7912170", "@7912171", "@7912172"} randomMap = math.random(1, #maps) print(table.getn(maps)) gameTime = 150 startObjects = 50 tfm.exec.disableAutoShaman(true) tfm.exec.disableAfkDeath(true) tfm.exec.newGame(maps[6], false) ui.addTextArea(69, "<a href='event:showAll'>...</a>", nil, 10, 30, 16, 15, 0x696969, 0x898989, 1, true) function drawInfo(id, name, event) list = "" for nick, obj in pairs(tfm.get.room.playerList) do list = list..obj.playerName.." "..counters[nick].."\n" end if event == "showAll" then ui.addTextArea(70, list, nil, 10, 50, 200, 200, 0x545454, 0x767676, 0.5, true) end end function drawInfo2(id, name, event) list = "" for nick, obj in pairs(tfm.get.room.playerList) do list = list..obj.playerName.." "..counters[nick].."\n" end ui.updateTextArea(70, list, nil) end isListEnabled = false function eventTextAreaCallback(id, name, event) if isListEnabled == false then isListEnabled = true drawInfo(id, name, event) else ui.removeTextArea(70, name) isListEnabled = false end end function draw() for name in pairs(tfm.get.room.playerList) do ui.addTextArea(tfm.get.room.playerList[name].id, "Objects left: "..counters[name], name, 680, 35, 200, 50, 0xFFFFFF, 0xFF0000, 0, true) end end function eventNewGame() randomMap = math.random(1, #maps) tfm.exec.setGameTime(mapTime) tfm.exec.newGame(maps[randomMap], false) tfm.exec.setUIMapName("Czarodziejh <BL>- <I>Mouseour 1.0.0</BL></I>") for name in pairs(tfm.get.room.playerList) do counters[name] = startObjects end draw() end function eventPlayerDied(name) counters[name] = startObjects draw() tfm.exec.respawnPlayer(name) end function eventNewPlayer(name) system.bindMouse(name, true) counters[name] = startObjects end function eventMouse(name, x, y) if counters[name] > 0 then counters[name] = counters[name] - 1; draw() tfm.exec.addPhysicObject(tfm.get.room.playerList[name].id, x, y, { type = 13, width = 10, height = 10, foreground = false, friction = 0, resitution = 40, angle = 0, color = math.random(0, 0xffffff), miceCollision = true, groundCollision = true, dynamic = false }) end drawInfo2(69, name, "showAll") end for name in pairs(tfm.get.room.playerList) do eventNewPlayer(name) end function eventChatCommand(name, cmd) if cmd:sub(1,11) == "setgametime" then gameTime = tonumber(cmd:sub(13)) elseif cmd:sub(1,15) == "setstartobjects" then startObjects = tonumber(cmd:sub(17)) end end TODO: - make a tutorial on how to add your own map to the script |
Maniaco « Censeur » 1662590520000
| 0 | ||
Nice module, keep it up! |