#modules
1 messages · Page 1 of 1 (latest)
/module shamousey ?
Or it doesn't works even here?
oh yes thank you! :D <3
oh sorry
thanks
how does playSound work? can lua team members use custom sounds or just game sounds?
when we can upload our own sounds
to which module
aurora
Hm
thx atelier, i was about to find out every piece of sound to download, now there's a list :D
cite18 it has a lot of interesting sound that you can use in minigames
It even has vampire sounds
Actually, that sound would be perfect on MyCity when it's raining.
yesterday a friend of mine pshy recommended the most calm sound ever http://audio.atelier801.com/deadmaze/x_amb_orage.mp3
omg..
they even have birds in there
Perfect for my troll event of November 😂
what troll event 
lol
Spoiler...
boiling soup?
it's raining a lot
Nice
Nice
woah
How did you trigger the thunder
cool
sound/music are really important element that makes the game more enjoyable
I don't know if it's already like this, but being able to press space to continue with the dialogue would also be nice, in games I prefer to press space or enter to continue than clicking on the dialogue window
yeah I agree with you
simple button system
@cobalt saffron space doesn't work in #aurora0poisson, with setWorldGravity you can get it working to freeze all the mice in place
they forgot to document the new function 
how to do if i have commands a b c in the image below which are executed in random order?
i hope u know what i mean
maybe you have to sfhfjfaff and sdfhfshgs
I assume you want this anyway
function callInRandomOrder(functions)
table.sort(functions, function() return math.random() > 0.5 end)
for i, f in next, functions do
f()
end
end
local functions = {a, b, c}
callInRandomOrder(functions)
can you somehow detect that only on specific map function works?
Specify which map the function should work on? is possible with tfm.get.room.currentMap
If I'm not mistaken if it's vanilla maps currentMap will be -1 but common maps created by players will show up with the code in integer
tysm 🙏
TIL that this parameter exists
I've always used fixed rotations or XML so I never looked up at it lmao
how can i set two spawn points considering two teams
i mean, one team spawns on one side and the other team on the other side
One single spawn in the center and instant teleport based on the team when new game starts
then on eventPlayerRespawn (if your player respawns), do the same
i will try, thank you!
alternate reality
Nice but bruh.. Did you change your mouse's image? >.>
There was no image with centered space for the mouse to be visible
Hmm
I was surprised because the giant hole jumps like the mouse, so I thought you had replaced the image...
how to detect player holding "x" key
system.bindKeyboard("+Bnpy#0000", 88, true, true)
function eventKeyboard(name, key, down, x, y)
if (key == 88) then
-- if down is true then the key is being pressed, if false then the key has been released
end
end
can anyone help me how to lets players teleport to a place when they reach a certain number of players in the script
You need to track how much players are there. I'd recommend having two variables, one for total players and other for alive players. After that, you only have to check when a new player joins the total number of players, and if it exceeds the max value you set, you teleport them.
I'd also recommend to track if the Player was teleported through a table, so you don't teleport everyone each time a mouse joins the room.
local totalPlayers = 0
local alivePlayers = 0
local miceLimit = 5 -- How many mice are needed to teleport everyone
local playersToTeleport = {} -- Stores what players should be teleported
function eventNewGame() -- On eventNewGame everyone gets respawned so the alive players is equal to the total players
alivePlayers = totalPlayers
end
function eventNewPlayer(playerName) -- Increase the total players when a new player joins
totalPlayers = totalPlayers + 1
tfm.exec.respawnPlayer(playerName)
playersToTeleport[playerName] = true -- Player is added to the list
if totalPlayers >= miceLimit then -- If the amount of players reach the limit you set, then...
for Player, _ in pairs(playersToTeleport) do
tfm.exec.movePlayer(Player, x, y) -- Move players pending to teleport to the desired coordinates
end
playersToTeleport = {}
end
end
function eventPlayerDied(playerName) -- Decrease alive players if one dies
alivePlayers = alivePlayers - 1
end
function eventPlayerRespawn(playerName) -- Increase alive players when one respawns
alivePlayers = alivePlayers + 1
end
function eventPlayerLeft(playerName) -- Decreases total players when one left the room
totalPlayers = totalPlayers - 1
end
for playerName, Player in pairs(tfm.get.room.playerList) do -- Must call eventNewPlayer for players already in the room since it doesn't trigger automatically
eventNewPlayer(playerName)
end
tysm
waiting for simon says module
woooo 
Nice, it's a shame that the npc image slips but quite interesting a battle system in mice
i am using tfm lua well
i have made
spawns 50 balls in the center of the room and nothing else
Now im trying to make my gamemode and cannot figure out how to turn off the shaman
tfm.exec.newGame("@7915328")
function eventNewGame()
tfm.exec.disableAutoShaman(true)
tfm.exec.addShamanObject(604,400,200,0,0,0,false)
end
tfm.exec.disableAutoShaman(active)
Thats in there
Ah yes, it only works for the next round
So you disable auto shaman at the start of the new map, but it will only take effect after that map ends
hm do objects not become nil when off the edge?
Just need to create a respawning object
What do you mean?
Objects should despawn when they fall to void
However I think their ids stay in tfm.get.room.objectList
When you use tfm.exec.addShamanObject it returns the object's id, so you can track which objects are spawned through a table
You can add a timestamp with a delay for the object and on eventLoop check the time and despawn them, even if they've reached the corner
local objectDespawn = {}
function SpawnBall()
local delay = 3000 -- It's on milliseconds
local id = tfm.exec.addShamanObject(6, 400, 200, 0, 0, 0, false)
table.insert(objectDespawn, {id = id, timestamp = os.time() + delay})
-- (os.time() + delay) means "The current time in milliseconds, plus the delay I've specified"
-- This means, if we compare that timestamp with the current time, it will only be inferior if the current time is greater than the delay
end
function eventLoop()
local index = 1
local object
while index < #objectDespawn do
object = objectDespawn[index]
if os.time() > object.timestamp then
tfm.exec.removeObject(object.id)
table.remove(objectDespawn, index)
else
index = index + 1
end
end
end
I don't know if that's what you mean, if you need to check if a object is on the edges then you can access its values in tfm.get.room.objectList[id of the object].x and .y, and in eventLoop spawn/despawn them accordingly
local ball_id
function SpawnBall()
return tfm.exec.addShamanObject(604, 400, 200, 0, 0, 0, false)
end
function eventLoop()
if ball_id then
local ball = tfm.get.room.objectList[ball_id]
local shouldRemove = false
-- This assumes the map is 800x400, but you can modify the values on the right according to your maps
if ball then
if ball.x < 0 or ball.x > 800 then
shouldRemove = true
elseif ball.y < -200 or ball.y > 400 then
shouldRemove = true
end
else
ball_id = nil
end
if shouldRemove then
tfm.exec.removeObject(ball_id)
ball_id = nil
end
else
ball_id = SpawnBall()
end
end
Not sure whats wrong here but i cant get the game to delete the object a shaman summons
tfm.exec.newGame(6)
for name,player in pairs(tfm.get.room.playerList) do
end
function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, objectType, other)
tfm.exec.addShamanObject(54,xPosition,yPosition,angle,xSpeed,ySpeed,false)
tfm.exec.removePhysicObject(objectType.id)
end
You have two objectType 👀
It shows 2 on the wiki, which one do i remove?
figured it out
my function was wrong and i should use removeObject
eventSummoningEnd ( playerName, objectType, xPosition, yPosition, angle, objectDescription)
objectType : the type of shaman object (i.e. ball, box, balloon)
objectDescription : a table with the object description as it would appear in the objectList
You should refer to the documentation in the forums https://atelier801.com/topic?f=6&t=781139 instead of the Wiki, but it seems like the forums have it wrong too :p
-- Actually, the last argument seems to repeat twice 😯
now to quit goofing of and make a gamemode of sorts
which i will do tomorrow
as soon as i have an idea someone hasnt already done
(i was working on soccer before but someone already has) :(
just got home, i think it works? lmao
tbh i dont even know what happened
okay um
i cant figure out how to select a random player and put their name in a variable
just once
figured it out
Players in tfm.get.room.playerList are organised through associative indexes, for selecting a random element from a table it has to be a table of numerical indexes. So you have to iterate over playerList and insert each one with table.insert in a new table.
Then, to get a random member you pick a value from 1 to the amount of players
local pickPlayer = {}
for playerName, Player in pairs(tfm.get.room.playerList) do
table.insert(pickPlayer, playerName)
end
local randomPlayer = pickPlayer[math.random(#pickPlayer)]
Alright who wants to come play my lua thingy in my tribe house?
idk how to get the command for people to join tho
/inv username#0000
how do i turn off the stupid "3, 2, 1, go" with multiple people
or at least a way to change maps without newGame()
You can't ;c
ah well im working around it for my script
whats even more annoying is that it doesnt show up if there just one person
I have a new module idea
Module where everyone spawning at flat map, everyone is shaman and having skills. They are building and reviving if died
What are they supposed to build
anything they want
Like that Build competition in Micecraft? Where you're asked to build some object with blocks and people vote for the most accurate construction
#cbase bt с картой где добавлены штуки из навыков через хмл код может сработать мб
Понял
Very enjoyable
😱
👁️
Credits to Mckeydown#0000
How can I increase the player's height?
in the tribal house
tfm.exec.changePlayerSize(playerName, size)
size: between 0.1 (smol) and 5.0 (huge), being 1.0 normal and default size
"Tsunkeru#1367" mayb
For future reference - strings aka literal text require quotes around them, otherwise they are interpreted as the name of a variable
Since there isn't a defined variable with the name Tsunkeru#1637 and # isn't a legal character for variable names anyways, the script fails
np!
hello I've created a searchable /luahelp page
https://webninjasi.github.io/tfm-luahelp/
open to your suggestions
amazing work and it is really helpful
This is amazing, very good Lays
that's smth we really needed
It'd be nice if you marked the stuff that just MTs can use
Well, technically it isn't just MTs, but yeah, an indicator would be nice
done!
You've got a little mistake there, FunCorps don't have access to file-related functions but do have access to everything else
Thank you! It's corrected now.
what is the module
what currency
$ <
question: when will the pac-mouse funcorp module thing become official like parkour, unotfm, freezertag etc.?
In my opinion some gamemodes should remain as funcorp specific modes, if it became official it would not have as many players as they do during funcorps since the playerbase is not big enough to fill all of its modules. Part of the fun is the large amounts of people in a funcorp room and by not being always available it retains that fun spark of "YES PACMOUSE ROOM"

pro
Soon...
amazing
NNNNEEEEEEEEEEEEEEEDDDDD
we need that but I need to work on the assets and the maps and @tame granite need to work on the code
shoook
OMG
will the mouse roll like sonic or run
Bonsoir
run, but they will gain speed while moving
Here's the Lua code of the Musical event, if anyone wants to give it a look.
🤨 🧐
How can I make a quicksand floor that isn't as strong? 



What?
Make it heavier?
Makes it not sink as fast
Tried to make a code to link 2 random mice with the command !link, failed hard
for name,player in pairs(tfm.get.room.playerList) do
table.insert(players,name)
end
function eventChatCommand(name,command)
if command=="link" then
tfm.exec.linkMice(Player1[math.random(#players)], Player2[math.random(#players)], true)
end
end ```
found a code to link mice but can’t add the text command in there…any ideas?
``` local players={}
table.foreach(tfm.get.room.playerList, function(n) players[#players + 1] = n end)
for i=1,#players do
if players[i+1] then
tfm.exec.linkMice(players[i],players[i+1])
end
end```
function eventChatCommand(playerName, message)
local args = {}
local command
for arg in message:gmatch("%S+") do
args[#args + 1] = arg
end
command = table.remove(args, 1)
if command == "link" then
local mice = {}
if #args > 1 then
mice = args
else
for name, _ in next, tfm.get.room.playerList do
mice[#mice + 1] = name
end
end
if #mice > 1 then
for i=1, #mice - 1 do
tfm.exec.linkMice(mice[i], mice[i+1], true)
end
end
end
end
Usage:
!link : Links all mice
!link a b c : Links a with b, and b with c. Can add more players
Wow, ty 🙂
i need help finding 2 modules:
the 1st one: u need 2 players (or more idk) and try to avoid the shark on the side of the screen chasing u while running across
the 2nd one: there isnt an objective, u just run down a very long rainbow pathway which takes a few mins
I think the 2nd one is #aurora0rainbow
yes ty c:
i know who made the first one
who? please
is it possible to send a chat message to the normal chat instead of lua chat in the tribehouse?
Nope. It is only possible if you're FunCorp or Module Team
Can you put multiline text in a text area?
This doesn't work:
local str = 'Your size: ' .. self.size .. '\n'
str = str .. 'test'
ui.updateTextArea(1, str, playerName)
Textarea is too small to display the rest (you can scroll down tho)
Yes, you can. The text area must be tall enough so all text can be displayed, otherwise it will be cut.
If both the width and height are 0, only width will work, and the height will not adjust correctly.
🤔 Tig could add a parameter to add scrollbar to the textarea, it would be more interesting and fluid than doing with the lua api
you back 
Yes lol, for the joy of some and the sadness of others.
I was curious to see how the community was
mostly the joy for us all

I have seen you help others and give tips for years
Yeah but I've been away for a while working on some stuff... Now I have a little more time to play and chat.
I'm currently thinking about becoming a bit more active in the Lua Transformice development community, I have a few ideas in mind.
Maybe, but my main idea is to help enrich developers' experience. I have a few things in mind for this.
For example, I know that many devs use a tool in python to be able to separate their minigames into different files and be able to put everything together in a single file, but that completely discards the feeling of modules that you have in regular Lua.
local module = require("./module")
module.doStuff()
A tool that allows you to package Lua modules would be more interesting.
You are also not able to test your module before playing in transformice and hope you don't have errors, it's something that needs to be fixed...
I did some sort of script that can merge various files from different directories, assert whether or not the syntax is correct and execute some events to emulate a game initialization; it may not catch all bugs but it helps to detect some of them easily
It's not something big tho, I can share it if you need it
Hm, I'm thinking of making a tool in rust and creating an extension for VSCode. I intend to learn more about rust this would be a good project to help in this regard.
But yes, it would be very useful, I can study your code for inspiration
I intend to allow the standard lua syntax (require-return) and provide a way to test the main game events like eventKeyBoard and others. I even thought of making the tool initialize a local server to test the script in real time but that could be considered piracy despite not being playable in a multiplayer sense so I think it will be possible to just develop the debugger
Perhaps I could ask tig for permission to develop a super-limited local server only allowing testing Lua functions, but it is very likely that he will deny it.
Is it possible to make someone look either right or left?
I think it's not possible
who made it and whats the module name
i'm not sure, the guy who mades it don't log in the game anymore
aw ok if anyone knows whats its called pls lemme know :c
hmm, 1st one is #unlocker0shark ?
omg yes ty ^^
HELP in utility how do i unadmin someone?
!unadmin [name] - Takes away admin rights from a player
!admin [name] - Grants a player admin rights ( admin rights can't be removed unless you type !unadmin [name] in the chatbox)
I hope it will help
is it possible to disable confetti sounds or disable it altogether?
You can't disable players' sounds through Lua, only by yourself on settings by clicking on the sign that looks like a musical note
Wait theres sounds in this game
Yeah music note is sound effects, speaker icon is music. Makes total sense. At least the bell for notifications is reasonable.
Ever since i started playign i had sounds off 💀
I left the sound effects enabled and disabled only the music
i enabled the sounds when they add sounds to modules
Does anyone have the script of @merry parcel to do giveaways?
are you asking the community or Ninguem 👀
I think both
there was old giveaway module made by an Arab dev
you can find it in the Arab module forums
this and there is another one
There is another one in portugese but i lost it.
i found
i copy from tfm 😐
Is LUA easier than JavaScript?
How about Java
Those are the only two I have good knowledge of
Java I learned in a course, and JS by myself when I didn’t know it was near useless
Java is definitely harder than Lua. For JS vs Lua, it mostly depends on what do you want to focus, although JS is a bit higher level than Lua as it has more built-in functionalities
In my opinion, Lua is much simpler compared to Javascript, whether it's how objects work or the syntax.
Both are dynamically typed languages but JavaScript has a lot of boilerplate and a lot of features, while Lua lacks some features common in many languages it has an syntax easy to understand and work with. JavaScript, on the other hand, was made to have backwards compatibility, which makes the language load a lot of old boilerplate and mix with current features.
When Module API switching to Lua 5.4 and breaking 100% of Modules 
Hardly, it will only happen if JIT upgrades to Lua 5.4
I don't think Tig would use a common version of Lua
They don't even use LuaJit :sadge:
:v yes, and tfm uses
It's LuaJ, regular Lua but written in Java instead of C
I don't think so, there is a mixture of Lua 5.1 and Lua 5.2 that only LuaJIT does
well, i'm not 100% sure only who can confirm that is Tig
On the bright side, if MAPI goes to Lua 5.4 we will have constants using attributes
Hm
local foo<const> = "bar"
foo = "baz" -- assignment error
You can actually notice it's LuaJ when you get these messed up errors due to recursion or using a built-in function wrong - the Java part fails and throws a Java error
Hmmm, yea, makes sense
welcome back 👀
hello 🥰
forget it, Roblox really did a good job with Luau
It would be interesting to have this as a module api although it might break all modules :v
tig could add "script versions"
the current modules run on the old API version, and the new ones can use the new API
That would be unsustainable for many Module developers
this looks bad in the long run
Why
also there are many scripts used by people and they're written on the current version
Suddenly 2/3 of scripts ever made have to be rewritten
well actually that's a bit dramatic lmao but the amount of scripts affected would be important
Yup, the versioning issue is that it would complicate something that should be simple, at least on the server side. It's easier for Tig to take a recent version and do its best to make compatible with current scripts, so devs have to deal with very few changes.
Imagine if there was a different bug in each version, Tig would have to maintain each version, and for each version of Lua the code changes a lot at some point, Lua 5.4 is already almost completely different from Lua 5.1 [ talking about source-code of Lua in C, not the language itself ]
Lua 5.4 supports a lot of Lua 5.1, the difference is in small changes in the syntax, addition of attributes and removal/addition of some functions besides the addition of bitwise operators and the builtin utf8 table of lua 5.3
Poor Fofinhoppp to rewrite MyCity lol, as far as I know his code went from 10k lines
Hii @mild sage how do i use your Lua events in the tribe?
For The Orchestra, you can't run it because it uses system.newTimer and some playerData functions.
I will ask if it can be enabled to load with /module for those interested in playing it ;p
Ok. @hidden trail and @open crypt too?
I want to play your events too, please
Is it possible to tell whether an object was spawned by the map or by a shaman? Even if a shaman object was spawned by the map, eventSummoningEnd still gets called with playerName of either the shaman or the person who ran the script
You can deduce the origin from the object ID on the objectList.
ID < 200 : Map
ID > 200 : Lua (tfm.exex.addShamanObject) spawned object
ID > 11000 : Shaman spawned object
thanks!
What if the module spawns 11k objects? will the id go from 11k or reset to 200?
Perhaps the api should have a property on the table that declares the object's invocation mode invokedBy module, shaman, map
Well, that's a lot of objects 😮 if you spawned one object per second on the same map it would take three hours to get to that number
10 objects each 500 ms...
and would despawn soon after
It could even be 25 every 500ms
A regular module wouldn't do that, but what if the module was played in a room for 5 hours spawning objects on the same map?
Oh??
How different are the languages? Like do we use commands like functions, if/else statements, arrays, variables, etc.?
I remember watching a video about lua before and found out that they have pre-made functions… is that true?
Commands? Functions are functions, there's no commands. And yes, all languages have built-in (pre-made/native) functions.
The differences lie in their syntax, application and features.
The ID will continue to go up past 11000, and if you try to summon anything (the game will try to summon an object with an id that is already occupied) the game will freeze until you let go of the mouse button, and if you hold it for long enough you will see that a count will appear on the object in the shaman menu that goes down very quickly and when it hits 0 you will run out of the objects (which proves that you don't actually have infinite objects, there is a limit how many you have, you just don't see it if the count is high enough)
The limit of objects is 100, and the count will be visible if the count is below or equals 20, this can be noticed in normal gameplay too, if you spam arrows, for example
Interesting
I expected something like this to happen, but I didn't know that a counter would appear.
You can now run The Orchestra Lua Event on your tribehouses.
/module evt_music
Hm, events can now be run using the evt_ prefix?
Lua Events are modules internally. Yes, they have the prefix evt_ but most of the time they get into a Disabled level (like archived, can't run with /module) instead of (semi-)official. It depends on each Event and its coder
Got it, interesting
/module evt_music
doesn't work
Is it? In Lua maps I've significantly exceeded this limit in XML and I'm pretty sure that I've also filled maps with more objects as a shaman; the event guide (https://atelier801.com/topic?f=6&t=860194&p=1#m1) even says there can be 509 physical objects (including shaman objects) in a room
I mean the limit of a particular object that a shaman can spawn
There can much more than 509 physical objects, but dynamic objects will break on the API side when there are more than 100, more objects than that won't be synchronized by server
Players are handled differently, so they are not included on that count
It should be fixed now
the translation also works, great job 👍
Can I try the new event "Hoppy Chinese New Year" in tribe house ?
Only when the event ends
Wow, this map turned out amazing . I hadn't played the event, I've been busy.
Where are the other events?
Somewhere in the Abyss of Archived Modules
Won't there be commands to run in the tribehouse?
I can't make others people events available as I was not the main programmer of these, you have to contact each one of them if you want their events to be playable on Tribehouses
Do you only have this event made by you?
I did three events, two in collaboration with Drgenius. The Nightmares Hunt I'd say is mostly him, because he was the host and did around 3/5 of the code. If you want to play that one, you should ask him ^^
The Music Event was done as well with him, but I was the host and we agreed to make it publicly available
and the current one running, which I can't make available yet
New Module Soon!
Hey, is there a way to pickup the cheese and not to die at the bottom of the long vertical map?
||MAP='<C><P H="40000" MEDATA="1,1;;;;-0;0:::1-"/><Z><S><S T="10" X="411" Y="39950" L="1127" H="93" P="0,0,0.3,0,0,0,0,0"/><S T="15" X="425" Y="39292" L="924" H="159" P="0,0,0,0,0,0,0,0"/></S><D><DC X="426" Y="134"/><F X="421" Y="39763"/><P X="240" Y="160" T="160" P="0,0"/><P X="560" Y="885" T="160" P="0,0"/><P X="255" Y="1620" T="160" P="0,0"/><P X="600" Y="2575" T="160" P="0,0"/><P X="220" Y="3520" T="160" P="0,0"/><P X="630" Y="4640" T="160" P="0,0"/><P X="225" Y="5505" T="160" P="0,0"/><P X="610" Y="6475" T="160" P="0,0"/><P X="195" Y="7655" T="160" P="0,0"/><P X="600" Y="8920" T="160" P="0,0"/><P X="260" Y="10130" T="160" P="0,0"/><P X="675" Y="11650" T="160" P="0,0"/><P X="160" Y="13175" T="160" P="0,0"/><P X="545" Y="14610" T="160" P="0,0"/><P X="330" Y="16180" T="160" P="0,0"/><P X="775" Y="17720" T="160" P="0,0"/><P X="160" Y="18665" T="160" P="0,0"/><P X="695" Y="20585" T="160" P="0,0"/><P X="215" Y="22400" T="160" P="0,0"/><P X="680" Y="24195" T="160" P="0,0"/><P X="280" Y="25835" T="160" P="0,0"/><P X="595" Y="27615" T="160" P="0,0"/><P X="280" Y="29345" T="160" P="0,0"/><P X="650" Y="31175" T="160" P="0,0"/><P X="145" Y="33225" T="160" P="0,0"/><P X="645" Y="34955" T="160" P="0,0"/><P X="235" Y="36805" T="160" P="0,0"/><P X="685" Y="38440" T="160" P="0,0"/><P X="230" Y="39525" T="160" P="0,0"/><P X="550" Y="39075" T="160" P="0,0"/><P X="230" Y="38755" T="160" P="0,0"/><T X="415" Y="188"/><DS X="392" Y="122"/></D><O/><L/></Z></C>' tfm.exec.newGame(MAP)||
The game probably stores your coordinates as 2-byte signed integers (limit 32767), and after it reaches more than 32767, it will go into the negatives and it will cause bugs, so your best bet is to keep your map height below that.
What's interesting is that your player position from tfm.get.room.playerList can be above 32767, however any event that you cause will say that your position is negative, and the game kills you if you're too high up too.
i haven't logged in to tfm in a long time but i do remember very tall maps being possible and even helping someone out with an event that required that mechanic
the lua position is in fact transmitted as a signed short, but lua is a different vm that's running in the server
for some reason there are some... weird mechanics that happen in the server code
such as the server actually storing your position as a signed integer (4-byte) but sending it to lua as a signed short (2-byte)
such as in an event, like eventKeyboard, as the client itself sends your position for that specific event as a signed short
it's as i said, some weird mechanics
movePlayer sends both the position and velocity as shorts
and it was needed for the event that I mentioned to be able to teleport someone reaaally far away
so what they did was to just trigger movePlayer multiple times and playing with the offset
as the new position is calculated in the client side, you can just say "move to y 32767" and then just say "add 5000 to your y position", effectively teleporting past the 32767 limit
The source code for the Lua Event Hoppy Chinese New Year of 2023 is public now.
"As bombinhas são super altas e tem um pavio muito curto! Eu não os deixaria bravos se fosse você!"
isso não tem sentido em português
"Firecrackers are super loud and they have a really short fuse! I wouldn't make them mad if I were you!"
loud = barulhento, não alto
@hexed rock perguntando pra um event squad br...
mas qm faz as traduções dos eventos?
Tem uma galera que ajuda a traduzir, mas vamos dar uma olhadinha e corrigir 💓
Obrigado pelo toque
mas acho que traduziram pra alto pelo barulho ser alto, mas faz mais sentido como barulhento mesmo
Eu acho que poderia ser "As bombinhas são barulhentas e de pavio curto! Eu não as irritaria se fosse você!"
4 dias atrais
8 dias atrais
What is this module?
Thank you.
ofc
we can ask @halcyon arrow or @tame granite to host another test room or a real funcorp
Lua Event Hoppy Chinese New Year is now available to be played on Tribe houses.
/module evt_hoppy_cny
Hm, could tig make a command like /modulelist where it shows all available modules in the tribe including events? It would be easier to have a whole list ready to go
you can do /module to show all available public modules but I think that command doesn't show event modules
It doesn't, and it also doesn't show all the modules, only the official ones if I'm not mistaken
But in this case it would be better to update /module than to create a new command. I just wanted to add context to the suggestion.
It only shows official modules
The list is huge, I doubt it would fit the game chat 😜
not in the chat... interface, preferably one that has buttons to visit the official rooms if available or run in tribe house
🥺 I wish we had our own interface for searching Modules
https://atelier801.com/topic?f=6&t=892566 in the meanwhile there's this (a bit outdated)
Sonic The Mouse in TFM now!!
I hope you guys enjoy it, remember to be fast!!
brought to you by @tame granite & @halcyon arrow & @whole tide
also, thanks to @mild sage for the help with uploading the images and sound effects.
https://atelier801.com/topic?f=6&t=896069&p=1
Hmm, what is this Pshy lib? I've never seen this before, looks interesting
lua maps
Amazing
Just because I was programming it went into maintenance ;-;
Tig could fix the __len metamethod, it would be very useful #table not return 0
https://gist.github.com/Hadaward/da9ef08437e614a3d6a134bf0b48152f
I made some useful functions for dealing with tables in Lua in tfm I took inspiration from JS object and array functions and added table.length
👀
Update on #basketball:
The bug with the ball power is due to a bug in the new Transformice update. I've released a temporary hotfix in the meantime, but the ball seems to be behaving strangely still. There's not much more I can do about this until the TFM bugs are fixed, sorry!
Can someone reset the football module? Something weird happens when shooting the ball and it's been like this for ~3-4 days now.
The #basketball module has been facing some bugs recently after the update that occured on 3/2/2023, it experienced anormal ball speed when released, but I believe Drgenius fixed that however there's still another bug which is the ball disappears when you release it, this isn't normal and should be immediately fixed, although we also hope that the Leaderboard is brought back after this matter is settled @shut wolf
ah..
please return chess module
yeah right 😭
modules are still bugged 💀
how funny that modules are given no f's about whilst they are literally the most played out of the gamemodes that you have including vanilla 😭
You can temporarily fix scripts you run manually by adding this snippet at their very beginning:
local incorrect_tfm_exec_movePhysicObject = tfm.exec.movePhysicObject
tfm.exec.movePhysicObject = function(id, x, y, pos_offset, vx, vy, speed_offset, ...)
return incorrect_tfm_exec_movePhysicObject(id, x, y, pos_offset, (vx or 0) / 10, (vy or 0) / 10, speed_offset, ...)
end
drgenius did the same for his module but the ball still behaves strangely
Tig's intervention is needed lol
Yeah, objects seem to disappear when moving them. Not sure if this is the same bug, but it's likely related since it was a much more rare occurrence before. Likely has to do with synchronization
is there anything else you can do regarding the issue? cause well #soccer is now functioning properly after integrating the script above
I will keep investigating. So far I have no idea what could be causing the disappearing bug. None of the code has changed since before this was an issue
much appreciated if it's as soon as possible, also try to work on bringing back the leaderboard
checks the functions that were updated, it could be one of them, if for example it has a high speed the object would simply "disappear" out of the map
@halcyon arrow all modules that have moveObject aren't working properly anymore whenever you shoot the ball it's like ten times more force it goes to the sky, this happens in #football and #basketball, let us know if you can help figure out how the ball still disappears in basketball after applying a hotfix
I tested moveObject and it seems to not have changed (my modules using it didnt have their behavior changed).
On the other hand, movePhysicObject had its behavior altered, it now moves ground 10 times faster than before.
However, this is now coherent (previously the speed unit of both functions was different, now it is the same).
The ball in #basketball may actually not be a ball but a ground, so it's affected by this change.
However after testing some cases, it appears using strings as ids for grounds instead of integers can cause grounds to disappear.
As for why the "ball" disappear, i do not have access to the source code of the module, so idk if this is what they are doing.
I updated my snippet to fix this if this is the reason.
@shut wolf
It's a shamanObject with an image attached
This week is very busy for me, but I'll look into it more when I get the chance. Thanks for the info!
💀
The #basketball ball de-spawning bug should be fixed now!
bring leaderboard back
is there any indication on when the football module will be fixed?
switch to #Soccer
Wiz is a talented games maker, I always loved his minigames and modules
-- Define some constants for the arrow's speed and lifetime
local ARROW_SPEED = 300
local ARROW_LIFETIME = 2000
local arrows = {}
function shootArrow(playerName, x, y)
-- Calculate the arrow's velocity based on the player's current position and the mouse cursor's position
local mouseX, mouseY = tfm.get.room.mouseX, tfm.get.room.mouseY
local dx, dy = mouseX - x, mouseY - y
local distance = math.sqrt(dx^2 + dy^2)
local vx, vy = dx/distance * ARROW_SPEED, dy/distance * ARROW_SPEED
-- Create a new arrow object with the calculated velocity and add it to the arrows table
local arrow = {x = x, y = y, vx = vx, vy = vy, lifetime = ARROW_LIFETIME}
table.insert(arrows, arrow)
end
-- Register the function to the space bar key event
tfm.exec.bindKeyboard("space", true, true)
-- Define the update loop that will be called every frame
function update()
-- Iterate over all active arrows and update their positions based on their velocities
for i, arrow in ipairs(arrows) do
arrow.x = arrow.x + arrow.vx * tfm.get.room.deltaTime
arrow.y = arrow.y + arrow.vy * tfm.get.room.deltaTime
-- Decrease the arrow's lifetime and remove it from the arrows table if it has expired
arrow.lifetime = arrow.lifetime - tfm.get.room.deltaTime
if arrow.lifetime <= 0 then
table.remove(arrows, i)
end
end
-- Draw all active arrows on the screen
for _, arrow in ipairs(arrows) do
tfm.exec.displayProjectile(1, arrow.x, arrow.y, arrow.vx, arrow.vy)
end
end
-- Register the update loop to the tfm event loop
tfm.exec.setRoomStickiness(false)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disablePhysicalConsumables(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.setGameTime(0)
-- Register the shootArrow function to the space bar key event
tfm.exec.addPhysicalButton(" ", 0, 0, 20, 20, "shootArrow")
(it doesn't work ofc but crazy how it still knows some of the methods
idk what is room stickineess tho lmao??
yea, chatgpt
tfm.get.room.deltaTime
yup + wind
Extremq#0000 has decided to retire from the Module Team.
!setscore [red-blue] does not work in #basketball and also some other commands @shut wolf + leaderboard isnt back yet
hello, can someone help me on a little lua thing
how can i add a handler or smt that reads if a player presses a button
for example, like in bootcamp, i want to add a hotkey for /mort, which is g
okay i found a way to get a key input but now idk what numeric code to use to read the key g
okay i found the way
the way
i did it
i basically did this
idk what the g, x and y stand for in the eventKeyboard function
i put g at first thinking it would get the key from somewhere but it doesnt do anything apparently

No developer for Mycity
@grave ember en el foro de ES hay un hilo que tiene todos los códigos de las teclas
tmb esta la documentación que actualizo frecuentemente
Ohhh/:
Hello everyone
⚽ The background in **#soccer **has been updated.
||If I know you, enter #soccer and try to find yourself in the background.||
You can find a list of key codes here: https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html
eventKeyboard's arguments in order are:
- the player name (
player) - the key code (
key) - whether the key was pressed down or up (a boolean, you called it
g, you may call itdown) - x coordinate where the key was pressed
- y coordinate where the key was pressed
- speed the player had over the x axis
- speed the player had over the y axis
You can type /luahelp in-game to display documentation.
Documentation from the forum (may not be as up to date): https://atelier801.com/topic?f=6&t=781139
same
34mice on pk? 
Naz is a talented games maker, I always loved his minigames and modules
False, I'm no such thing
right you’re a chicken I forgot
Naz you're better than me,you think im a good games maker but no.
it all depends on the game idea and you're better than me at this. 
but from another point of view i'm younger than you
(16 years old)
Thank you, but you see, age has nothing to do with creativity. Also without the help of my friends Pshy, Lays and others I would have never been able to make any game.
Hey guys, I wrote a code which is: There is an image, if you are near it and press S, it will disappear.
The problem is that the image disappears for me and for others as well. So I wanted it to disappear for me only when I press S, and disappears for them only when they press S.
This is an example of the code:
Can anyone solve my problem please ?!
a = tfm.exec.addImage("177fc344c1b.png", "_1", 2980, 435, nil, 0.8, 0.8, 0, 1, 0.5, 0.5)
function eventKeyboard(name, keyCode, down, x, y)
if keyCode == 3 then
for playerName in next, tfm.get.room.playerList do
if (tfm.get.room.playerList[playerName].x) >= 2950 and (tfm.get.room.playerList[playerName].x) <= 3010 then
if (tfm.get.room.playerList[playerName].y) >= 405 and (tfm.get.room.playerList[playerName].y) <= 465 then
tfm.exec.removeImage(a, name)
end
end
end
end
end
for playerName in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(playerName, 3, true, true)
end
I didn't test but should work. You can specify a specific person to hide the image (tfm.exec.removeImage(imageID, playerName)
didn't work
It still disappears from their screen after I pressed S
@hidden trail
oh yeah i see why now
I editted the code try it out now
Also you don't really need to loop through the player list to check the coordinates, just checking the coordinates of the person that pressed the key is enough
a = tfm.exec.addImage("177fc344c1b.png", "_1", 2980, 435, nil, 0.8, 0.8, 0, 1, 0.5, 0.5)
function eventKeyboard(playerName, keyCode, down, x, y)
if keyCode == 3 then
if (tfm.get.room.playerList[playerName].x) >= 2950 and (tfm.get.room.playerList[playerName].x) <= 3010 then
if (tfm.get.room.playerList[playerName].y) >= 405 and (tfm.get.room.playerList[playerName].y) <= 465 then
tfm.exec.removeImage(a, playerName)
end
end
end
end
for playerName in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(playerName, 3, true, true)
end
really
well that's odd, maybe it's the time to log into tfm and test it myself without being lazy
oh sorry turns out you cant actually remove an image for a specific person
local imgIds = {}
function eventKeyboard(playerName, keyCode, down, x, y)
if keyCode == 3 then
if (tfm.get.room.playerList[playerName].x) >= 2950 and (tfm.get.room.playerList[playerName].x) <= 3010 then
if (tfm.get.room.playerList[playerName].y) >= 405 and (tfm.get.room.playerList[playerName].y) <= 465 then
tfm.exec.removeImage(imgIds[playerName])
end
end
end
end
for playerName in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(playerName, 3, true, true)
imgIds[playerName] = tfm.exec.addImage("177fc344c1b.png", "_1", 2980, 435, playerName, 0.8, 0.8, 0, 1, 0.5, 0.5)
end
``` @vagrant hollow try this one out?
np! :D feel free to ask if you have any question
So if I want to add another image with the same concept (press S to disappear), how can I do that without making the first image disappears also when I want to disappear the new one?
@hidden trail
You can pretty much do like the same thing with a liiitle bit of altering here and there.
local imgIds = {}
function eventKeyboard(playerName, keyCode, down, x, y)
if keyCode == 3 then
if (tfm.get.room.playerList[playerName].x) >= 2950 and (tfm.get.room.playerList[playerName].x) <= 3010 and (tfm.get.room.playerList[playerName].y) >= 405 and (tfm.get.room.playerList[playerName].y) <= 465 then -- i simplified it here
if imgIds[playerName] then tfm.exec.removeImage(imgIds[playerName][1]) end
end
if coordinateCheckforOtherImage then
if imgIds[playerName] then tfm.exec.removeImage(imgIds[playerName][2]) end
end
if coordinateCheckforotherotherImage then
if imgIds[playerName] then tfm.exec.removeImage(imgIds[playerName[3]) end
end
end
end
for playerName in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(playerName, 3, true, true)
if not imgIds[playerName] then imgIds[playerName] = {}
imgIds[playerName][1] = tfm.exec.addImage("177fc344c1b.png", "_1", 2980, 435, playerName, 0.8, 0.8, 0, 1, 0.5, 0.5)
imgIds[playerName][2] = tfm.exec.addImage("your other image")
imgIds[playerName][3] = tfm.exec.addImage("your other other image")
imgIds[playerName][4] = tfm.exec.addImage("your other other image")
end
But as you can see this might get messy if you keep adding more and more. So inthat case I'd handle this in a completely different way. I can do that for you aswell but not now
I wanted to add 14 images in total
oh i see, then you could also give a try for the other method I told you (which I'd explain). Or you can just carry on like this aswell if you want to
yeah you will have to do the what you did with the previous image for the new images
if (tfm.get.room.playerList[playerName].x) >= 2950 and (tfm.get.room.playerList[playerName].x) <= 3010 and (tfm.get.room.playerList[playerName].y) >= 405 and (tfm.get.room.playerList[playerName].y) <= 465 then -- i simplified it here
if imgIds[playerName] then tfm.exec.removeImage(imgIds[playerName][1]) end
end
should i repeat that or this
if coordinateCheckforOtherImage then
if imgIds[playerName] then tfm.exec.removeImage(imgIds[playerName][2]) end
end
just replace coordinatecheckforotherimage with the new coordinates
coordinatecheckforotherimage, do you add "other" to the code ?
otherother?
If you're tired of explaining, just send a full code. Then I will imitate what you did.
-- just put your image data here
local images = {
["177fc344c1b.png"] = {"_1", 2980, 435, 0.8, 0.8, 0, 1, 0.5, 0.5, startX = 2950, stopX = 3010, startY = 405, stopY = 465 },
["otherImage.png"] = {...}
}
local playerImages = {}
function eventKeyboard(playerName, keyCode, down, x, y)
local player = tfm.get.room.playerList[playerName]
if keyCode == 3 then
for imageID, imageData in next, images do
if player.x >= imageData.startX and player.x <= imageData.stopX and player.y >= imageData.startY and player.y <= imageData.stopY then
tfm.exec.removeImage(playerImages[playerName][imageID])
end
end
end
end
for playerName in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(playerName, 3, true, true)
playerImages[playerName] = {}
for imageID, imageData in next, images do
playerImages[playerName][imageID] = tfm.exec.addImage(imageID, imageData[1], imageData[2], imageData[3], playerName, imageData[4], imageData[5], imageData[6], imageData[7], imageData[8], imageData[9])
end
end
or you can try something like this, just put your image data on top and the code will manage the rest
again i was lazy and didnt test so hope it works
lol
The concept worked well (The image disappear from my screen only when I press S) but only the last image
in "local images = {}" appears on the map when the room starts.
@hidden trail
can you send your code here or in me dms so i can test aswell
oh ya i see, i thought they are going to be different images
local images = {
{"177fc344c1b.png", "_1", 100, 300, 0.8, 0.8, 0, 1, 0.5, 0.5, startX = 70, stopX = 130, startY = 270, stopY = 330},
{"177fc344c1b.png","_2", 200, 300, 0.8, 0.8, 0, 1, 0.5, 0.5, startX = 170, stopX = 230, startY = 270, stopY = 330},
{"177fc344c1b.png", "_3", 300, 300, 0.8, 0.8, 0, 1, 0.5, 0.5, startX = 270, stopX = 330, startY = 270, stopY = 330}
}
local playerImages = {}
function eventKeyboard(playerName, keyCode, down, x, y)
local player = tfm.get.room.playerList[playerName]
if keyCode == 3 then
for imageID, imageData in next, images do
if player.x >= imageData.startX and player.x <= imageData.stopX and player.y >= imageData.startY and player.y <= imageData.stopY then
tfm.exec.removeImage(playerImages[playerName][imageID])
end
end
end
end
for playerName in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(playerName, 3, true, true)
playerImages[playerName] = {}
for imageID, imageData in next, images do
table.insert(playerImages[playerName], tfm.exec.addImage(imageData[1], imageData[2], imageData[3], imageData[4], playerName, imageData[5], imageData[6], imageData[7], imageData[8], imageData[9], imageData[10]))
end
end
King best Lua dev
Hey, I would like to know how exactly to use the eventTalkToNPC function? I want to make my NPC talk once someone clicks on it, but I´m not sure how to implement it... Since once I tried, it gave back an error (Init Error : Lorenzzo#9356.lua:216: attempt to call nil) and I´m not quite sure on how to do the whole strings, etc thing. I have this bit ready:
local look = tfm.get.room.playerList["Lorenzzo#9356"].look
local npcDef = {
title = 558,
look = "165;0,0,0,0,60_fa1919+ff0000+2305ff+900f31+20310+de2c2c+2b04b8+ff0000+fa1919+ffffff,130_bd1010+ff3041+2b04b8+de2c2c+fa1919+6f3131+2305ff,4_3700ff+bf0c0c,108_ff0000+2b04b8+ffffff,0",
x = 60,
y = 163,
female = false,
lookAtPlayer = true,
interactive = true,
}
tfm.exec.addNPC("Lorenzzo#0000", npcDef, nil)
But I´m not sure what to do from there. I´d really appreciate some help :)
what's the line 216?
Add this code to yours:
if npcName == "Lorenzzo#0000" then --Write between "" the name which you gave to the NPC in tfm.exec.addNPC
ui.addTextArea(101, "<font size='14'><p align='center'><font color='#ffffff'>Hi World!", nil, 20, 80, 80, 20, 0x000000, 0x010000, 0.7, false) --Write here the code which will happen when you click on the NPC (I added a textarea for the example)
end
end```
Thanks for the response!!! I tried it but how can I make it so that only the player that clicks can see it? cause for some reason once someone clicks it, everyone else can as well :(( and how can I make it so that it closes afterwards?
change nil to playerName in ui.addTextArea
You can consult the API docs (through forums or /luahelp command) every time you are wondering to do something in your script, most of the time you can find the functionality there
Unless is outdated
it probably is
welp
thanks a lot for the help :)
Squid-Game-TFM Funcorp_script Comming Soon... 
Hello guys, I wanted to make a timer and decrease its value every 500ms after pressing a button ,using eventLoop. But the code didn't work for some reason.
ui.addTextArea(101, "<font size='14'><p align='center'><font color='#ffffff'>Timer: "..timer, nil, 200, 100, 200, 20, 0x000000, 0x010000, 0, true)
ui.addTextArea(102, "<font size='14'><p align='center'><font color='#ffffff'><a href='event:example'>Button</a>", nil, 200, 140, 200, 20, 0x000000, 0x010000, 0, true)
function eventTextAreaCallback(textAreaID, playerName, callback)
if textAreaID == 102 then
function eventLoop()
timer = timer - 1
ui.addTextArea(101, "<font size='14'><p align='center'><font color='#ffffff'>Timer: "..timer, nil, 200, 100, 200, 20, 0x000000, 0x010000, 0, true)
end
print("Success")
end
end```
Fix it please.
You can't declare your events like that, events get evaluated at init and are immutable so you can't override them in runtime. That means that they will only apply when your script is loading, not when it is already running.
In case you're having just a single timer, you can add a boolean when clicking textArea 102 and check if that boolean is set to true on your eventLoop, to substract 1 from your Timer.
local timer = 60
local isTimerActive = false
ui.addTextArea(101, "<font size='14'><p align='center'><font color='#ffffff'>Timer: "..timer, nil, 200, 100, 200, 20, 0x000000, 0x010000, 0, true)
ui.addTextArea(102, "<font size='14'><p align='center'><font color='#ffffff'><a href='event:example'>Button</a>", nil, 200, 140, 200, 20, 0x000000, 0x010000, 0, true)
function eventTextAreaCallback(textAreaID, playerName, callback)
if textAreaID == 102 then
isTimerActive = true
print("Success")
end
end
function eventLoop()
if isTimerActive then
timer = timer - 1
ui.addTextArea(101, "<font size='14'><p align='center'><font color='#ffffff'>Timer: "..timer, nil, 200, 100, 200, 20, 0x000000, 0x010000, 0, true)
end
end
I guess you want to make something happen whenever the timer reaches 0 but you can add that by yourself under the timer condition in eventLoop. However if you need more than one timer then you need a whole Timer class to manage all of them
Thx! 
This is not entirely true tho, you can create your own event system if you like, _G['eventLoop'] = something works anywhere in the code. Lua is not compiled.
function eventNewGame()
_G["eventLoop"] = print
end
tfm.exec.newGame(0)
Just a test snippet
Just a PS: functions are block-scoped so that's why declaring eventLoop inside another function doesn't work, but using the global object to declare does, unless Tig changed the behavior.
That will not work if the call isn't registered on Init, at least that's what happened when I tried it.
The event call will suffer some form of "optimization" and "caching" once Init finishes and you won't be able to overwrite it. They are registered on the server after all the script is evaluated and get called from there, they do not access the _G environment.
local counter = 0
local a = function()
print("a")
end
local b = function()
print("b")
end
function eventKeyboard()
print("init")
end
function eventLoop(e)
counter = counter + 1
if counter == 10 then
print("switching to b")
_G["eventKeyboard"] = b
elseif counter == 5 then
print("switching to a")
_G["eventKeyboard"] = a
end
end
system.bindKeyboard("Indexinel#5948", 32, true, true)
If you press space, you will see that even after the counter reaches 5 or 10, the only function that will execute will be the one defined at initialization
It would be cool to change the behavior on runtime tho
Oh yes, in that case it makes sense, the tests I did are static so it's considered pre-runtime.
Like an event emitter can be done easily, although not necessary.
tfm.events:on("Keyboard", function()
print("first call")
tfm.events:off("Keyboard")
tfm.events:on("Keyboard", print)
end)
Is it possible to do something like this if you create an event system, I didn't implement it because I'm not at home
But honestly I never found a use for an event system in tfm, like, why change the behavior of an event for all players?
Unless you're making something like Bolo or Mistens, creating a minigame with several minigames embedded. In that case it makes sense.
Yeah, it's mostly about when you have a main game and several mini-games, although Bolo's or Minstens' systems are more focused on preventing the Module to crash hard and instead send a log report. In most cases, the Module host won't be connected and if the Module has an unprotected call that produces an error, it will stop the whole thing without the host being able to check any logs.
Event handlers have other specific uses, -not only on TFM, but on any game- when you want different things to happen when a player is in different locations or under certain circumstances, without creating a mess of spaghetti code.










agreed
quip game.....
The doll outfit 
#modules How can I disable player's W, A, S and D? So if he wants to move, he won't.
You can't 
but you can freeze the player so he can't move.
tfm.exec.freezePlayer (playerName, freeze, displayIce)
Oh thx!

omg yes
villages be like
#modules How can I count the number of players in the room and make something happen when the number is 0?
Seeing as the room would cease to exist when it reaches 0 players..
But to count the players in the room: tfm.get.room.uniquePlayers
Is it now a publicly accessible variable? I recall it returned nil both with FunCorp elevation and without it
It's only available for Module Team and Lua Events as it is only relevant when counting players for saving stats
And you can pretty much know if someone is an alt or not with it so...
You can still count the number of players by creating some counting method, although I would prefer Tig fix the __len metamethod so #table doesn't return 0 when tables isn't empty. (I mean, come on, in Lua 5.1 it's super easy to fix this language bug by compiling your own version, imagine using a Java interpreter, just modify it)
https://gist.github.com/Hadaward/da9ef08437e614a3d6a134bf0b48152f
See table.length you can do table.length(tfm.get.room.playerList)
It's better to use uour own counting method, as player list won't update properly or fast enough in many cases
True, but I still confused about finding a method
hi anyone knows if there is a way to have custom textures in game?
You only need to preserve a variable and keep adding or removing players through eventNewPlayer and eventPlayerLeft.
local totalPlayers = 0 -- At the start of your script
-- ...
function eventNewPlayer(playerName)
totalPlayers = totalPlayers + 1
end
function eventPlayerLeft(playerName)
totalPlayers = totalPlayers - 1
end
-- eventNewPlayer won't trigger for players in room already, so we need to trigger it manually.
for playerName, playerData in next, tfm.get.room.playerList do
eventNewPlayer(playerName)
end
This code will only show me the number of players who join the room, but what about the players who were already in the room when the code started?!
You need to trigger eventNewPlayer manually for every player at init. I've edited the code to show that ^^
You can also keep similar logic for alive players with eventPlayerDied and eventPlayerRespawn
Do you mean I add this:
for playerName, playerData in next, tfm.get.room.playerList do
eventNewPlayer(playerName)
eventPlayerLeft(playerName)
end
Nope, you only want to register the players already in room, so just trigger eventNewPlayer. If you trigger eventPlayerLeft as well then those players will be treated as if they've leaved the room and the counter will be kept at zero
Thanks for the method. I understand now, I really needed it.
indexinel is very smart 😄
continue you are a legend
pls fix LAG in the module 
New version will be less laggy
lowerSync?
No, that's other stuff
Current version in-game is laggy, it does so many unnecessary stuff in the code and some things are poorly implemented (just like real Minecraft lol)
This version is done from scratch, with better design and code behind it
also I'm planning to make it have its own style, not like the average 2D Minecraft project but something a more different. I suck even for pixel art so I will see if I find any artist once I finish coding xD
Tell me when they r going to fix parkour' choco sticky roof in maps?
It is not parkour problem, the whole maps with sticky ceiling are broken: bootcamp, racing, etc..
for anyone that uses #utility the !pet spawn pet now moves really fast how can i change its speed or make it move slower?
btw this is what im talking about 
looks like 'ground collision' option interfere with its behaviour
This is caused by a change in the Lua api, utility needs to be updated to accommodate it.
@dusky minnow Congrats on joining the MT team 🎉
Thanks! 
Can someone explain what Tig meant in that last ad? 🤔 the statement was very confusing despite being fun.
@tame granite TrapRun need this, the objects go nuts when I trigger the trap
reminds me of bumper cars
another random video from space
I'm famous haha
damn, this is so good, when u going to share the script?
When I have a playable version, I will send a link here. 😄
You can now play as any ship in the game and npc ships and players are teamed together by faction. (I did not draw the ships btw)
I'll stop spamming chat with space Lua, sorry xD
keep sharing, there is not much going on here
unfortunately the game crashes a lot due to Lua overload
Warning : Runtime can't exceed 40 ms in 4 seconds ! Currently : 40 ms. 
40ms for normal player right?
yes, but it doesn't work on 60ms either
Modules are limited to 60 ms if i remember correctly, maybe I'll come up with something that will reduce runtime 😄
• Hey everyone Squid-game is out and more in my Forum Topic.
Enjoy
https://atelier801.com/topic?f=6&t=898293&p=1#m1
how can I add random backgroud into XML?
I tested it out like this, but the backgound is not showing humm
}
randomBg = background[math.random(#background)]
gameMap = '<C><P D="randomBg.." /><Z><S><S L="802" H="30" X="400" Y="389" T="5" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="361" X="400" /></D><O /></Z></C>'
tfm.exec.newGame(gameMap) ```
background = { "x_transformice/x_maps/x_peche2014/x_temple.jpg", "x_bouboum/x_fond/x_f5.jpg", "x_transformice/x_maps/x_papaques_2015/map2.jpg"
}
randomBg = background[math.random(#background)]
gameMap = '<C><P D="' .. randomBg .. '" /><Z><S><S L="802" H="30" X="400" Y="389" T="5" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="361" X="400" /></D><O /></Z></C>'
tfm.exec.newGame(gameMap)
It's '..randomBg..' not just randomBg..
Some simple examples for similar situations:
local batata = "Potato"
print("I love " .. batata )
--or print('I love ' .. batata)
local batata = "Potato"
print("I love " .. batata .. " very much" )
--or print('I love ' .. batata .. ' very much' )
--or print("I love " .. batata .. ' very much' )
ahhh thank you so much Pro!
can I upload an image to the forum (https://atelier801.com/topic?f=6&t=893819) and then use it in the tribe map without lua?
nope
Yes
Open miceditor on any browser, add any ground, then in its setting click on 'use ground image'. Put the url of the image(that you uploaded in image upload center), in 'URL' field.
I did this, but the image does not appear
It actually appeared in the first photo, you should know that the image size based on image dimensions when it was uploaded
So you can't stretch it or make it bigger
the first image is a miceeditor. I need my picture to be visible in the tribe room
Make another ground to respawn the player on it, then copy the code of the map. Try it in map editor in game.
I used them and it worked
are they lua images or images from tfm database
Images URLs from image upload center
thats tfm database images
Nah
Database is something different
A whole website
For tfm, boubom, dead maze and so on
@vagrant hollow so I have this url for lua image i uploaded
http://images.atelier801.com/181d0b2d7df.png
can you make it appear in normal code map ?
You can only upload images that are hosted on the atelier database if you are not using lua. And in the same way, if you are going to use lua you need someone from the module team to upload the image at images.atelier801.com since all lua images are loaded from there.
Sure! But I can't do that now because I'm not at home, I will back on Thursday..
I misunderstood you, the image can only be used in a script using lua, sorry guys

LOLLLL
honestly idk hwhere to tell this but utility has major issues rn
it crashes for no reason
uhh
i know its a problem to report to the ujh owner of the module but i have no idea who is he
records module has also been suffering issues, I think it’s a tfm issue but I’m not sure why it happens
there's been a person that has been crashing utility and micecraft with just joining and being like 2 or 3 seconds on the room who said that is grth demon and it's breaking the fun tbh
it must be some sort of code
i think this is bannable idk
i feel they're just trolling but i think they're doing it abusively
plus just look at the account date
should i report this
i mean im posting this in the modules channel bc it's about modules anyway
Miroslavchik#0000 released new maze 👍
https://atelier801.com/topic?f=6&t=886588&p=1&d=1#m7
hehehe
I think it's better to report it to mods
room #aurora0poisson
anyone knows what's this img called? (utility)

Is there a library for TFM events and functions that can be used in external editor like VSC?
like this ?
This is a website. What I need is a library like in some other programming languages
import library_name
@whole tide
It depends on the said language the lib is coded in
and also the library that has different naming
a lua library has different functions compared to another library, of any language including itself
Lua natively has require but tfm has removed the function, so at most you can use a bundler to bundle all files into one.
i did report him to mods but he's still not banned
should i just whisper one
is it possible to make an NPC play an emote?
I read the documentation, and there is no mention of it being possible, nor from the function that adds the NPC, nor from the function that makes a player play an emote
hey, I started making a project that allows you to collect several lua files into one and automatically run it in transformice
https://github.com/mdpakhmurin/tfm-lua-launcher/tree/main
cool 
star it if you like it ^_^
@steady pasture
wow that looks awesome
Guys, i have a problem with #anvilwar
This module was mine and the current host player is Indexinel (not sure what #tag is)
I'm not getting contact with Indexinel under Discord and Transformice, and the last applied update are from more than 5 months ago
What can I do?
sadly index isn’t here anymore
you can contact a module team member, maybe they can help you with that
i contacted two module team members, and one said that I should contact Matza
because only the hoster can work/update on the modules they created or hosted, for that you need a module team member to accept being a hoster for this module then they need Matza approval and she will transfor the module to them
epico
Is it possible to set some custom "flags" on shaman / physic objects in map editor to check for them by code?
okay, I found how to do this, its possible to set custom parameter in object's xml code and check for it later with this function:
local function parseXML(xml)
local objects = {}
for element in xml:gmatch('<S (.-)/>') do
local attributes = {}
for key, value in element:gmatch('(%w+)="(.-)"') do
attributes[key] = value
end
if attributes['lua'] then
local object = {
T = tonumber(attributes['T']),
X = tonumber(attributes['X']),
Y = tonumber(attributes['Y']),
L = tonumber(attributes['L']),
P = attributes['P'],
o = tonumber(attributes['o']),
N = attributes['N'],
lua = tonumber(attributes['lua']),
flag = attributes['flag'] -- Our "custom" flag
}
table.insert(objects, object)
end
end
return objects
end
We can set flag in our map's xml:
<S T="13" X="362" Y="240" L="10" P="0,0,0.3,0.2,0,0,0,0" o="324650" lua="1" flag="remove"/>```
And then check for it with:
```lua
print("<R>Map XML:</R>")
if tfm.get.room.xmlMapInfo.xml~=nil then
local xmlCode = tfm.get.room.xmlMapInfo.xml
local objectsTable = parseXML(xmlCode)
for _, object in ipairs(objectsTable) do
if object.flag ~= nil then
print("Removing physic object with flag: "..object.flag.." ID: "..object.lua)
tfm.exec.removePhysicObject ( object.lua )
end
end
end```
Result (console):
• [00:18] # Removing physic object with flag: remove ID: 1```
its important to set lua=id parameter in most cases so we can remove our object with tfm.exec.removePhysicObject function, otherwise we can't
also, there is a "bug" (or just game limitation) so we can't check for map's xml code without waiting at least 1.5s (otherwise table is not created yet) so its better to set an 1.5s timer every time we use it
i thought you probably had to wait so i tried a wait function for half a second but obviously not enough cause it was broken. doesn't make sense to me since the map can load fine before you even try to access the XML
btw tfm.get.room.xmlMapInfo.xml works only after calling tfm.exec.newGame and eventNewGame functions (idk why but ye)
also, maps are probably load from other (thread?) with access to xml code from database
because they can trigger stuff before even lua is called (for example dissapear flag on physic objects can be called after just 1ms)
but its probably tribe limitation because module rooms have instant tfm.exec.newGame called and you cant really do this in tribe because it will load @0 map or images wont work
well, find that strange anyway, apparently the XML is decompressed in-game. maybe the lua interpreter on the server has to do it separate instead of just getting what's already in the game. i don't see why though.
I knew that, so I tried that, but I have used the XML function before when writing a function to replace objects with defilante bonuses.. I didn't need to use a wait function or anything but it wouldn't let me see the XML directly
I think that maybe the game doesn't want you copying people's maps
you can
the only problem is that print() and textarea uses "<" and ">" to format text
local xmlCode = tfm.get.room.xmlMapInfo.xml:gsub("<", "<"):gsub(">", ">")```
here you are ^
well a delay in when you can get the map limits how quickly you can get the map data to stop someone from copying maps en masse, it might be the intention
and it won't let you use "<" and ">" in game? you can type those characters into chat with no problems..
OH
user messages are different
i find it funny that the lua interpreter lets you format text in it
I made a whole script for getting maps codes, wait a second
function getXML()
if tfm.get.room.xmlMapInfo.xml~=nil then
currentXML = tfm.get.room.xmlMapInfo.xml:gsub("<", "<"):gsub(">", ">")
print("<J>New Map Started</J>\n<R>XML Code(in parts):")
print("\n<R>XML Code (Part1):</R>\n\n<font size='1' ><N>"..currentXML:sub(0,4000).."</N></font>\n")
if (currentXML:len() > 4000) then
print("\n<R>XML Code (Part2):</R>\n\n<font size='1' ><N>"..currentXML:sub(4001,8000).."</N></font>\n")
if (currentXML:len() > 8000) then
print("\n<R>XML Code (Part3):</R>\n\n<font size='1' ><N>"..currentXML:sub(8001,12000).."</N></font>\n")
if (currentXML:len() > 12000) then
print("\n<R>XML Code (Part4):</R>\n\n<font size='1' ><N>"..currentXML:sub(12001,16000).."</N></font>\n")
if (currentXML:len() > 16000) then
print("\n<R>XML Code (Part5):</R>\n\n<font size='1' ><N>"..currentXML:sub(16001,20000).."</N></font>\n")
if (currentXML:len() > 20000) then
print("\n<R>XML Code (Part6):</R>\n\n<font size='1' ><N>"..currentXML:sub(20001,24000).."</N></font>\n")
if (currentXML:len() > 24000) then
print("\n<R>XML Code (Part7):</R>\n\n<font size='1' ><N>"..currentXML:sub(24001).."</N></font>\n")
end
end
end
end
end
end
end
end```
this function splits xml code in parts and prints it in 1 pixels font
cool..
it have single letters lose due to text format but you can actually copy whole map by putting output to miceditor (it will fix it automatically)
remember to call it after newgame function inside of eventNewGame with 1500ms delay

okay, it looks like you done the hard part yourself though which is a good thing
thanks
isn't there a savefile function in the TFM lua? if that existed it would be much easier
I have scripts with like 3000 lines 💀
sounds like you might have made one of those mario or sonic remakes
I believe lua that you run inside of tribe is executed by vm so it dont really mess with game servers because it have small limits
nope, actually I didnt make any working whole playable module yet
just came back to tfm after 4 years of programming in other games so Im making one rn but api scares me hard
i don't think there is anything to fear in TFM api except maybe yourself
you can make most things by yourself but fact that you can use just 1 file at once make things hard
best thing you can do is making own systems like own event handlers so you dont have to put everything inside of single event
local eventSubscribers = {}
function subscribeToEvent(eventName, callback) --subscribeToEvent('eventName', function() end)
if not eventSubscribers[eventName] then
eventSubscribers[eventName] = {}
end
table.insert(eventSubscribers[eventName], callback)
end
function triggerEvent(eventName, ...)
local subscribers = eventSubscribers[eventName]
if subscribers then
for _, callback in ipairs(subscribers) do
callback(...)
end
end
end```
Usage:
```lua
function eventNewPlayer( playerName )
triggerEvent('NewPlayer', playerName)
end
subscribeToEvent('NewPlayer', function(playerName)
print('New player appeared!')
end)
subscribeToEvent('NewPlayer', function(playerName)
print('New player appeared but inside of other handler!')
end)
oh.. well i suppose we all have different styles of programming
i've never made any large programs myself
from my experience, its best to start with making useful tools like bundle of commands with own gui
my first code was just tool that uses every single tfm api function
i suppose i don't enjoy the task of programming itself, but i find it satisfying when i am able to do what i wanted to do, so i usually ignore whatever isn't necessary
I am working on a module and it will be ready soon , can anyone tell me where I can find shaman objects images ? Like those in tfm shop like beachaBall and cannon ?
Because they are very well designed
And thet have better quality than images I got from Pinterest or the cut ones I make 
Are there those img codes like blablabla.png ?
That need a FC member to upload them ?
Yeah
Atelier801 database makes no sense
I can't find a single image there
Oh I understand
Thx
I got them all , and my friend uploaded them too , ty for helping @lunar ridge
using the setPlayerCollision munition how do I increase the player's collision? I don't know how to manipulate bits and it's not explained properly in the documentation
but depending of what you want, there are other ways
'function eventContactListener(playerName, groundId, contactInfos)
print(playerName .. " hit the ground: " .. groundId)
end'
just remember that the objects need the contactListener = true
thanks
But i dont need for this, i using changePlayerSize funcion i forgot that function exists
😅
there is a way to know the execution time of a part of the script?
local t1 = os.time()
n = 0
for i = 1,100000 do
n = i
end
local t2 = os.time()
print(os.difftime(t2, t1))
#Lua says the script loaded in 24 ms
and the print says 23
It's correct, your script inside the sandbox shows 23 ms, when the script finishes the environment outside the script takes the control, imagine that it took 1 ms giving the control back to main program. It can be explained with something like:
- Delay during the script startup;
- Delay during the script execution;
- Delay while finishing the script execution;
Your case is the second, you get the measured time without external delays.
Thanks
Simple thing that i made
hi, how can i check if the x of the player is higher than something?
i'm trying to figure out lua lol
alright I figured it out
Where can I find a list of functions such as "tfm.get.room.playerList[n].x"? I've scrolled through the forum documentation and couldn't see it there
also is there any comprehensible tutorial which explains stuff such as creating variables, functions like the one above, or stuff in general
also also, is there any way to make you not die when you're teleported far?
also is there a "wait a certain amount of time before something next happens" command?
also, how to put a value from a color picker/popup in a variable
I don't think so, but I'm not sure
that only happens in defilante mode maps
ohhhhhhh right
if I were to just load a not defilante map using lua that would cease to be a problem, right?
normal mode with enough length and hight
oh thanks
also, how to make a variable that has an individual value for each player?
for example if someone clicks something which causes it to change, but it would apply only for them and not everyone
if anyone can send me any variable tutorial that would be great
you'd create it inside a function that returns the player's name, e.g.
function eventTextAreaCallback(id,name,callback)
variable[name] = "someValue" -- makes a variable for the player only
function(name) -- calls a function using the player's name
end```
hi, could you explain how the variable works/how to build it and what does the (second) function do? I don't really get it, sorry, I just started figuring out lua today
Also, would this variable work across multiple functions?
if it was first defined outside a function, yes
otherwise it would only exist within that function
the second is just a generic example, it can be any function
as for the first, the idea is that the name variable gets replaced with the clicking player's name, so it would create a "variable" variable.Aplejacek
(the real situation is a bit more complex, but in simple terms this is good enough)
i've tried using it but i think i'm doing it wrong, how could I fix this?
function eventChatCommand(playerName, com)
if com == 'a' then
ui.addPopup (1,0,b[name],playerName,350,200,100,true)
end
end```
function eventChatCommand(playerName, com)
if com == 'a' then
b[playerName] = 1
ui.addPopup(1,0,b[playerName],playerName,350,200,100,true)
end
end```
It works, thank you!
How could I define the variable outside the function, though?
I tried to make it so each time you summon the popup the number written in it increases
I'll test it here to see if I can find a way
b = {}
for playerName in pairs(tfm.get.room.playerList) do
b[playerName] = 1
end
function eventChatCommand(playerName, com)
if com == 'a' then
b[playerName] = b[playerName] + 1
ui.addPopup(1,0,b[playerName],playerName,350,200,100,true)
end
end
Thank you so much!
Np! 
hi could someone explain what does "in pairs" do?
Hmm, so it goes through every argument in a table?
Am I understand correctly that this code goes through the player list and creates a table variable for every player in the room?
for playerName in
pairs (tfm.get.room.playerList) do
b[playerName] = 1
end```
Is "playerName" specifically needed for this or could "playerName" be anything in this case?
Also, if one of the names was stored in a variable "c", would variable b[c] be the same as b[playerName]?
@lunar ridge
I used playerName in this case to keep everything the same and make it easier, but you can put anything
Alright, thanks
also how to remove npcs?
At the moment there is no way
aw, really?
can you update their position, at least?
I checked it, you can
phew, my idea is saved
btw, how to remove arguments from a table?
set their value to nil
hmmm alright
tfm.exec.giveCheese (playerName)
end```
How could I make it so I only get the cheese after a certain amount of seconds?
use eventLoop, it provides seconds as variables
thanks, will try it
also
how could I make added images make something happen when clicked?
is there a function for this tied to the image or do I need to check for distance
I'm having problems with the remove image function
I made a script in which an image appears in a random place, and when you press space near it then it vanishes and appears somehwere else. Everything else works fine but from the second time on the image doesn't dissapear (I put the layer depth in image identifier but I assume that's not how it works)
can someone explain how this image identifier thing works?
I think each new image has id increased by one from the previous one?
how can I see the id, though?
place invisible textAreas over them with <a href='event:someEvent'>\n\n\n\n</a>
the links call the text area event and the \n causes the link to apply for the entire width of the textarea rather than just the word
use variables
var = tfm.exec.addImage(...)
tfm.exec.removeImage(var)
Oh nice, thanks
why are four "\n"s needed, though?
the vertically bigger the image, the more \n-s you need
because the \n is still only the height of a single text line
alright thanks
how does this function work?
could I use it to set a variable to something when space is pressed and change it back when it's not pressed anymore?
what am I doing wrong here?
g=0
function eventKeyboard(n, k, d)
if d=='true' then
g=1
end
if d=='false' then
g=0
end
end
for n in next, tfm.get.room.playerList do
system.bindKeyboard(n, 32, true)
end
I see, thank you
although when I use else like this
function eventKeyboard(n, k, d)
if d then
g=1
else
g=0
print(g)
end
end
for n in next, tfm.get.room.playerList do
system.bindKeyboard(n, 32, true)
end
the print doesn't happen when I stop pressing the space key, would there be a way to do this?
Tysm!
good luck
What is the floor limit on Lua?
/room *#parkour00smol
yw! :D
<3
Hello, does someone know what are the admin commands for the volley room ?
When you create a volley room, you will find the "Menu" button on the top left of your screen. Click it, then click on "How to Play". There you will find all the commands you need..
To create a volley room, and be its admin: /room *#volley0Andrea#5371
Thank you 
Are mice still playing #circuit ?
Once i saw a room with 20+ mice but this was already a few weeks ago 
designed the UI for #ninja haha, how could I forget
how to open music with lua code ?
What is shamousey? Im new idk 
tfm.exec.playMusic ( music, Channel, volume, loop, fade, targetPlayer )
music - is basically the link that needs to end in .mp3, you can get already available ones by a801 at https://audio.atelier801.com/sounds.html.
channel - not sure about this but it can be anything, mainly this is used for tfm.exec.stopMusic(channel, name) but yeah, only 1 music can be played/should be ongoing(?) per channel
volume - should be a number from 0-100
loop - if the sound/music should loop, only will accept "true" or false"
fade - if the sound should start with a fade in (true/false)
targetPlayer - who should listen to it (e.g: "Blank#3495"), leave it nil if you want everyone in the room to hear it```
*#shamousey and *#divinity (mainly used) is made by a mt legend Shamousey#0095
Can you send me a random Lua code with a song?
*#shamousey is the beta version of *#utility, not *#divinity
TIL something new, sorry for misinfo 🫡
(my brain is addicted to divinity, meant to say utility)
tfm.exec.playMusic("cite18/musique/camp1.mp3", "test", 100, false, false)
few things i just learned:
- music can only be from https://audio.atelier801.com/sounds.html
- you have to remove "https://audio.atelier801.com/" from the start of the url
- having the ".mp3" at the end is optional
so helpful
i made one map for them
and rail accepted it
!!!
congrats
i try but not working :P
can you come dm ?
sure
If I added an image, how can I get the imageID? So I can remove the image using it
tfm.exec.addImage(imageName, target, xPosition, yPosition, targetPlayer, scaleX, scaleY, angle, alpha, anchorX, anchorY)
tfm.exec.removeImage(imageID)
the function returns the ID after you execute it, so what you need to do is something like:
tfm.exec.removeImage(id)```
Thanks!
Extremq#0000 has decided to return to the Module Team.
hello!
FIX VOLLEY PLESE
ayo can someone host the images that i sent on forum pls
What happened?
FIX VOLLEY!!!
me waiting for the upload of images on forum 
- Game freezes in
#basketballwhen in the lobby, it gets frozen and doesn't allow you to join the list and the timer stops - Bring the Global Leaderboard back in
#basketball
@shut wolf
Hi, sorry, trying to learn LUA
What does function bar(a,b,c) mean? The variables werent defined prior to the function
This is from learnxyinminutes.com in pinned post
what exactly is not clear? @storm bolt
the snippet showcases how you can create a function
function bar(a, b, c)
print(a, b, c)
return 4, 8, 15, 16, 23, 42
end
x, y = bar('zaphod') --> prints "zaphod nil nil"
-- Now x = 4, y = 8, values 15...42 are discarded.
When i learned JS, i usually did smth like
function functionName (if x == 0) {
// commands
};
So essentially, within the parentheses is a condition?
But here, it just has a few variables
I read it like “create function NAME and, when called, it will only occur if the if/else condition is met”
this is not valid
function functionName(x) {
if (x == 0)
// do something
}
are you sure it wasnt like this?
Oh wait
I think i misremembered
yeah, inside function paranthesis you only define parameters in JS and Lua
you can do that
but it is useful to have parameters
i recommend you research a bit
- Bring the Global Leaderboard back in
#basketball
@shut wolf
idk how many times i've made this claim and it hasn't been answered
yo is there any limit of how big a image can be in tfm?
iirc it cannot exceed 3mb when you upload it
unless you mean dimensions, in which case I think there aren't any explicit limits
It's because I put a really big image on forum but the size is 971 kb then should be fine
https://atelier801.com/topic?f=6&t=893819&p=38#m742 look at the last spoiler
https://pastebin.com/raw/nMpnh3Ts yo someone try this
Nice!
https://atelier801.com/topic?f=6&t=899204
Check out our new module Type or die
- Bring the Global Leaderboard back in
#basketball(for like the 5th time in a span of 2 years asking this) - Fix this issue where the entire module stops and it makes it seem like we are lagging, i double checked its NOT from the game.
@shut wolf
https://atelier801.com/topic?f=6&t=899214
A buckshot module
hi, i think that uno isn't working?
that's correct, we've disabled Lua for the time being to fix some bugs
alright, thank you for the answer!
tig already know how it was done?
some of the way to crash the server is the print function (this is the unique method that i know)
so removing prettyprint from lua tables/putting a limit of chars in strings should fix
hey @open crypt, modules are broken, can you fix them?
@whole tide its disabled whilst Tig is fixing bugs
ok, thanks honey
our beloved Santa, the community seeks your attention and help regard to modules 🙏
if coffeebot is bot or not? coz this guy sit on his own module room 24/7
just testing animation
wow that’s really cool
great work!!
👀
I recreated the Halloween 2010 event
New semi-official module called #factions is out!
How to play: Players are divided into two teams and each team has a tower that you must protect from the other team. You have to collect money around the map to upgrade team skills that will help you both protect your tower and destroy the opposing tower.
Official forum topic: https://atelier801.com/topic?f=6&t=899272
Gameplay video: https://www.youtube.com/watch?v=lnmyhsA5GYw
I released the module last night and made some quality of life changes this morning, so here is the changelog for version 1.1
➤ Players no longer collect money for the whole team, but instead collect it in their inventory. There is a team chest near the team tower where players can put their money for everyone. Therefore, trolls cannot spend all their money on unnecessary upgrades.
➤ Boxes now behave like pumpkins for more balanced gameplay.
➤ Reduced required activity of the losing team.
Have fun! 💚
I'm soooooooo fed up with parkour players who willfully ignore red bars! Something must be done to remediate that.


u here ? @merry chasm
get in touch with one
My module #bodykudo0catch - a gallery of maps designed for playing tag - has been available for quite a while, but I never announced it here in #modules:
The rules are simple. Tag, you're it! If you can't keep up the pace, you're going to get caught.
Want to play and read more info? Grab a friend or a few and check out the forum topic: https://atelier801.com/topic?f=6&t=898352&p=1#m1
⚠️ NOTE: The room is outdated. It is suggested you run the script from the topic instead.
Good job ♥️
achei
Improved water calculations

Do you know if there is a Pinturillo-style lua, where you draw and have to guess?
wonderful 😄
#micefall , a new semi-official Module!
Gameplay: All mice are flying in the sky with only 3 small boarders under them , all you have to do is using your attacking , teleportation and movement skills to push the other mice down while dodging their attacks.
Actually the module was out since two weeks but I had no time announcing it so here it is now . Have a nice time flying 🪽
Soon I will make a forum topic explaining the module more .
If you face any issues or errors in the module , feel free to DM me anytime 🫶
Module Image Upload Center is now up to date, for those interested in hosting images.
nice
does mycity has discord?
yes it does, you can find the link on https://transformice.fandom.com/wiki/Mycity
thanks
there is discord server for batata module
Autocompletion for ZeroBrane studio, now up to date. Put the file in Your_Zerobrane_Folder\api\lua directory, add api = {"transformice"} to your user settings and restart, then enjoy.
local loadBarSize = 5 --the size of the bar (number)
local loadBarTime = 12 --the time to complete in 0.5 seconds, so 12 = 6 seconds (int)
local _loadBarPlayers = {}
eventNewPlayer = function(playerName)
system.bindKeyboard(playerName, 32, false, true)
if _loadBarPlayers[playerName] == nil then
_loadBarPlayers[playerName] = {seconds = loadBarTime, imageStorage = {}, canPressSpace = false, loadBarSpace = 0, secondsNoChange = loadBarTime} --each 10 seconds, put all players with loadBar
end
end
for k in next, tfm.get.room.playerList do
eventNewPlayer(k)
end
eventPlayerRespawn = function(playerName)
_loadBarPlayers[playerName] = {seconds = loadBarTime, imageStorage = {}, canPressSpace = false, loadBarSpace = 0, secondsNoChange = loadBarTime}
end
eventLoop = function()
for k, v in next, _loadBarPlayers do
if _loadBarPlayers[k].seconds > 0 then
_loadBarPlayers[k].imageStorage[(#_loadBarPlayers[k].imageStorage)+1] = tfm.exec.addImage('185269e5376.png', '$'..k, -((_loadBarPlayers[k].secondsNoChange*loadBarSize)/2)+_loadBarPlayers[k].loadBarSpace+(loadBarSize/2), -(32+(loadBarSize/2)), k, loadBarSize, loadBarSize, nil, nil, 0.5, 0.5)
_loadBarPlayers[k].loadBarSpace = (_loadBarPlayers[k].loadBarSpace)+loadBarSize
elseif _loadBarPlayers[k].canPressSpace == false then
_loadBarPlayers[k].canPressSpace = true
end
_loadBarPlayers[k].seconds = _loadBarPlayers[k].seconds-1
end
end
eventKeyboard = function(playerName, keyCode)
if _loadBarPlayers[playerName].canPressSpace and keyCode == 32 then
for i=1, #_loadBarPlayers[playerName].imageStorage do
tfm.exec.removeImage(_loadBarPlayers[playerName].imageStorage[i])
end
_loadBarPlayers[playerName] = {seconds = loadBarTime, imageStorage = {}, canPressSpace = false, loadBarSpace = 0, secondsNoChange = loadBarTime}
----------------
--DO SOMETHING--
----------------
end
end
The snippet works, but I recommend the following:
- Use newlines and identation to separe larges pieces of code (that tfm.exec.addImage call, eventPlayerRespawn, eventNewPlayer) to help with readability. It will make it easier to maintain in the future; but it currently works as it is.
- In evetLoop for loop, use the field v which corresponds exactly to _loadBarPlayers[k]. This saves tables accesses and makes the code less verbose, repetitive, and instead easier to follow.
- You can get the same effect with a single image and manually scalling it on the X axis, however the math becomes more complex, so either is fine.
- I'd swap
_loadBarPlayers[playerName].canPressSpace and keyCode == 32, since if other keys ever get binded you would be unnecesarily comparing against the fieldcanPressSpace - It is not necessary to create a new table each time you press space. Instead just reset the fields, but that doesn't seem necessary for most of them except for
imageStorage. So I'd recommend you to use that same for loop, which is numerical, to clean up the table, adding a_loadBarPlayers[playerName].imageStorage[i] = nilafter removing the image. - I'd personally add a
local barPlayer = _loadBarPlayers[playerName]at the start of eventKeyboard, I know I'll be accessing it several times so localizing improves readability and table acceses.
thank you for all the recommendations, it was very helpful. especially the 2, 4 and 5. 
ill rewrite it
Actually the math for scaling up the image using the scale parameter is intuitive and easy to implement, basically it would require to compute the time factor passedTime / maxTime and multiply to scaleX.
The approach presented is not as efficient as directly calling a function when assigning a value. However, depending on the context of the script, it can be useful for situations such as setting minimum and maximum limits for numbers, adjusting text, formatting colors, among other reasons.
Example:
function _setmetatable(tbl)
local tbl = tbl or {}
tbl._internal = {variables = {}, functions = {}}
setmetatable(tbl, {
__index = function(self, key)
return self._internal.variables[key]
end,
__newindex = function(self, key, value)
local funcs = self._internal.functions
if funcs[key] then
self._internal.variables[key] = funcs[key](value)
else
self._internal.variables[key] = value
end
end,
__call = function(self, ...)
local args = { ... }
for i = 1, #args, 3 do
local key, func, value = args[i], args[i + 1], args[i + 2]
if key and func then
self._internal.functions[key] = func
self[key] = value
end
end
end
})
return tbl
end
_G = _setmetatable(_G)
_G('number', function(value)
return math.min(math.max(tonumber(value) or 0, 0), 100)
end, 150)
print(number)
number = 55
print(number)
number = 130
print(number)
number = -40
print(number)
number = 80
print(number)
100
55
100
0
80

local silly_flags = { "M1", "M2", "M5", "M6", "M_0", "M_1", "M_2", "M_3", "M_4" }
function eventChatCommand(name, cmd)
local index = tonumber(cmd) or math.random(#silly_flags)
tfm.exec.playEmote(name, 10, "../../" .. silly_flags[1 + ((index - 1) % #silly_flags)])
end
insane
hey siri can you revive this topic
#Spiritual, map difficulty 9 
Proo 
hey, i dont know if this is the correct place to say this or not, but there has been a series of hackers on guest accounts teleporting in batata and only killing specific people, basically making the game unplayable for anyone who isnt favored by them. i'd appreciate if the mods could actually watch batata a bit more closely? despite multiple reports over several weeks, this problem hasnt stopped.
theyre often online between 11am and 5pm EST
No u 
btw just wanna say, its to the point where me and my friends have discussed becoming mods ourselves bc most mods are never online or willing to help with this <3
Thank you for saying this!! It is actually a big problem in batata. And as a fellow player who gets targeted from the first seconds of a round starting, it is pretty annoying and makes the module pretty unplayable. Was considering taking a break from tfm with my friends, because we only have time to play batata and the hacking problem has been getting very excessive in the last 2 weeks. Also the hacks are blatantly obvious.
hey mods! this is happening right now in batata! id be willing to take a video if any of you want proof! nobody currently in the game is able to play it properly because of the sheer volume of hackers!
(If this continues to go unaddressed, i may consider directly pinging some people, as its crazy that yall have let this go on for weeks at this point with no action taken)
Go ping them, if nobody is attending reports it is worth to notify that there's uncontrolled amount of hackers systematically hindering the experience on a specific room. Specially when taking into account that the #batata module has no active developer to do anything about it.
im not sure who exactly to ping, but yeah. the hacker is deliberately attacking me and my friends to the point where we just- cant play anymore despite being batata leaderboard players
gonna ping a few people, i will say, the guests leave and come back periodically (likely to avoid banning) so you may enter the room and see nothing amiss, but dont be deceived
The people on the members list with yellow name are moderators, they can address hackers, even on #module rooms.
okay, got it, tysm
oh- but not all of them lmao
oh-
Do not mass ping all of us. For rulebreakers use /report command
i understand that, but ive received no reply despite the game being basically unplayable for multiple weeks
i will admit, the pinging is extreme but its disappointing that no action has been taken
Additionally, if the user isn’t being handled as quickly as you’d like, I suggest using the /ban user#tag command to vote-kick them from the room.
again, i understand, but removing them does nothing when they will only come back with another guest account.
its just incredibly disappointing to wait for weeks for action, receive nothing, and then be told that there is nobody i can speak to directly.
especially when the hackers are obvious and actively causing so much disturbance.
Yes, they're still open.
Sure, no problem
Hello people. I have re-established my module #indexinel.
If you have a small script that you want to see in rooms, but you don't want to make it a module yet, you can load it through my module. Send me your script, its name, the authors name and a brief description and I'll add it as a submode for #indexinel.
nezu mvp
mario,sonic and jumper pls
Share them to my DMs
can you do that implement functional tracker ?
What does it track?
NONE OF THE MUSIC IN THIS VIDEO IS MY OWN. Requested by Burnt Fishy.
You can view a list of all of the requests I have yet to get to here: https://docs.google.com/document/d/171d0S-n6zj7JjbNG_9pz1PfzZnNYbkfT3tz_ibpoA-g/
A huge thank you to Skye for recording the .wav files used to create this visualization!
Oscilloscope visuals created with ji...
it's old script
Not going to ping anyone, but just so the mods are aware, several accounts have been hacking in fake wins in batata. Diedenkevin is the main example, having hacked in literally 10,000 wins. Mega also hacked in 4,000 wins, although he attempted to make it less obvious. While this isn’t a huge thing, it is really annoying.


