#modules
1 messages Β· Page 4 of 1
No
U nb

2 nbs right now
No
You and @chrome mulch
I'm so pro 
Yes
Now 3 nbs
No @sharp portal so nb
4 nbs now π π
Wlc bruno
Goodnight all
@sharp portal @mild sage @chrome mulch Guys I'm sorry about pings just I joking
lets get back on the topic
for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.killPlayer(name)
end
@chrome mulch
function eventLoop()
for name in next, tfm.get.room.playerList do
tfm.exec.playEmote(name, 0)
end
end

@sterile sparrowno
@sterile sparrow yes

learn lua every day in #modules
and move ur pings to #cn pls its pretty ded there
player(discord.tfm.lua.channel) do
say("f")
end```
Maybe it's the Naomi's Programming Language
@sterile sparrow they migrated to the map channel instead lmao
Okay, sorry @sterile sparrow
no problem ^^
Thank you β€
@sterile sparrow so whatβs it like understanding moon code
i cant understand it cos i see no moon in the sky where i am
Sounds depressing
π€ Hey, to all who are good in lua, is it possible to make something like flipaclip in tfm? (Flipping animation maker, cuz i'm lazy)
no
you can
@chrome mulch

if
player(Melibellule#0001) do
see messages(discord.tfm.lua.channel), status=online(read=TRUE); then
player(execute.comand.self)do
delete(offtopic.messages), and
order(body)
NYOOOM
if
player(Melibellule#0001) do
see messages(discord.tfm.lua.channel), status=offline(read=FALSE); then
player(execute.comand.self)do
write(repeat, 9999999)=true(ping.random.user)
end
end```
Iβm disowning you both
TIMO NO
if msg.author.status ~= "offline" then
for message in channel:getMessages():iter() do
if not message.content:find("lua") then
message:delete()
end
end
else
for i = 1, 9999 do
message.author:send("@/Melibellule#0001")
end
end```
@cursive wedge look im crying
i love it
LOL
its better than what zyu and me both made toghether tho
animations dont really work out in lua, especially if there r lots of ppl in the room...maybe only using eventLoop may not crash
π€

i agree
I think Xavier
Lol ok

how I can do checkpoints?
Wat
@solid solar shooooould work but no promises
local SPACE_KEY = 32
local checkpoints = {}
function eventKeyboard(name, key, down, x, y)
checkpoints[name] = {x = x, y = y}
ui.addTextArea(0, "<a href='event:checkpoint'>Checkpoint</a>", name, x, y, nil, 20, 0x324650, 0x000000, 0.5, false)
end
function eventNewGame()
checkpoints = {}
ui.removeTextArea(0, nil)
end
function eventNewPlayer(name)
system.bindKeyboard(name, SPACE_KEY, true, true)
end
function eventPlayerRespawn(name)
if checkpoints[name] then
local coords = checkpoints[name]
tfm.exec.movePlayer(name, coords.x, coords.y)
end
end
function eventTextAreaCallback(id, name, callback)
local coords = checkpoints[name]
tfm.exec.movePlayer(name, coords.x, coords.y)
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)
-- Spacebar to checkpoint!
@cloud prawn good script its very nice π

π
WHO GHOSTPING ME
@paper niche
@sharp portal u want kiss?
π
What does "in moderation" mean?
to be used moderately
π I'd like a more detailed explanation
π
@ moderators why do u decrease the number of neutrons in me :(
So you cease to exist
bakatat
Restrain yourself
Kinky

hhi
Jfc 30 reactions what
34*
Can we get it pinned so I can stack reactions indefinitely ty
π
π
π
M00n

It's internet consuming because it sends a lot of packets if you use it in hacky way, but using it alone is just fine, however you have a limitation of 40 of them simultaneously.
However, Shamousey's doc is outdated. Check Pikashu's
When people will stop spamming moon things and really discuss about Lua
probably never :c
fun shit in #bolodefchoco0mastermind
π
π
this channel is SO boring
always
My OCD would be dead too, but it's not
i would be dead too, but i'm not

Sun
SUN AND MOON
Where is the lua event contest results? :C
i feel summoned
We are still voting! Stay tuned in the Announcements forum section, they'll be released there
β€
lua>>>???
@charred violetlua means moon
what does tat mean
Moon = lua (portuguese)
π
wrong, tat means pro
tat means baka
bakayaan
bakatat
has any lua functions been changed that i need to be aware about? im gonna be getting back into coding after a few years but i wanna make sure im not missing anything beforehand.

The version is still the same, but the api got some updates (https://atelier801.com/topic?f=5&t=451587)
i see. :0
why talk here
π€¦
but
ure gonna get urself
warned
...
ure like spamming here
if nobody know u talk with icecard on voice chat
π€¦
hi memorized it for u im tat
bakatat
bakayaan
bakatatat
bakayanananaan
bakatatatatatatatatatta
@sterile sparrow u wrong that means moon
tat means pro
tat means baka
keep it dead :c
end

there
if [#modules](/guild/246815328103825409/channel/501743449490325514/).dead==true then
keepitdead=true
end
== true
== true
sad
yes
Hi guys. Is it possible to make a script that runs maps chosen by me?
For example, I want the X, Y, Z maps to rotate in the tribe but I dont want to use /np. And I can add more maps later in the script. Initially, the maps I want to put are 7581582, 7584370, 7584378 and 7579745. There are a few more maps, but I can add it myself later. Oh, and it will be great if they appear randomly, not in order.
I tried to do, but only the first map in the list starts, and when the mice die, the next map doesnt start, the map #0 appears.
I know there are already modules with this purpose, like divinity and spiritual, but they are literally minigames, there is no way to change the maps. There is also the utility and the leafileaf, but they dont work the way I want it. My tribe creates maps for shamans, so it would be nice to have a script like this to test and play the maps.
Thanks for the help! I hope you understood xx π
Made this quickly π
hopefully should work
!map [mapCode] to add a map
local ADMIN = "Blackout#6525"
local MAPS = {
7581582,
7584370,
7584378,
7579745
}
local tempRotation = {}
function loadMap()
if #tempRotation == 0 then
for i, code in next, MAPS do
tempRotation[i] = code
end
end
local index = math.random(#tempRotation)
local code = tempRotation[index]
table.remove(tempRotation, index)
tfm.exec.newGame(code)
end
function eventChatCommand(name, cmd)
if name ~= ADMIN then
return
end
local arg = {}
for args in cmd:gmatch("[^%s]+") do
table.insert(arg, args:lower())
end
if arg[1] == "map" then
local code = tonumber(arg[2])
if code then
MAPS[#MAPS + 1] = code
tempRotation[#tempRotation + 1] = code
end
end
end
function eventLoop(passed, left)
if left <= 0 then
loadMap()
end
end
tfm.exec.disableAutoNewGame(true)
loadMap()
Thank you so so so so much!!!!!!!!!!!!!!!! β€ β€ β€ β€ β€
πͺπ»
Hiiii, I'm back. Lol.
Is it possible to remove the shaman skills and put a !Skip the map command?
@night depot ```Lua
local ADMIN = "Blackout#6525"
local MAPS = {
7581582,
7584370,
7584378,
7579745
}
local tempRotation = {}
function loadMap()
if #tempRotation == 0 then
for i, code in next, MAPS do
tempRotation[i] = code
end
end
local index = math.random(#tempRotation)
local code = tempRotation[index]
table.remove(tempRotation, index)
tfm.exec.newGame(code)
end
function eventChatCommand(name, cmd)
if name ~= ADMIN then
return
end
local arg = {}
for args in cmd:gmatch("[^%s]+") do
table.insert(arg, args:lower())
end
if arg[1] == "map" then
local code = tonumber(arg[2])
if code then
MAPS[#MAPS + 1] = code
tempRotation[#tempRotation + 1] = code
end
elseif arg[1] == "skip" then
loadMap()
end
end
function eventLoop(passed, left)
if left <= 0 then
loadMap()
end
end
tfm.exec.disableAllShamanSkills()
tfm.exec.disableAutoNewGame(true)
loadMap()
m00n
Pro
@mild sage
no
smh
Hell0
@civic burrow Is this possible to make a map changer like this? : Press O to change map to random.
Etc.
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAfkDeath(true)
function eventChatCommand(n, c)
local args={}
for s in c:gmatch("%S+") do
table.insert(args, s)
end
local cmd=args[1]:lower()
if cmd == 'map' and args[2]:match('^@?%d+$') then
map = tonumber(args[2]:match('^@?(%d+)$'))
tfm.exec.newGame(map)
end
end
did you mean it
!map @3131 for example
@charred pilot
U mean with a map table ?
P0
system.bindKeyboard(name, 32, true, true)
end
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
function eventKeyboard(name,key,down,x,y)
tfm.exec.newGame('#0')
end ```
press "K" to skip map
but there is no perm p0
which perm ?
function eventNewPlayer(name)
system.bindKeyboard(name, 32, true, true)
end
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
function eventKeyboard(name,key,down,x,y)
tfm.exec.newGame('#3')
end ```
here @charred pilot
np
Sorry, I was in the bus so I couldn't answer you @charred pilot. Let me know if you still need something!
they don't care
βΉ
cos module team isn't a staff position
Funcorp isn't either
That's not a reason, Tat.
Funcorps can add reactions and they're just like us.
The min. they should do is to put MT, FS, Translator roles here, so we could put reactions too :p
Also @sterile sparrow shouldn't you update your nickname here to Tat?
If he is too lazy to leave and quit, he is too lazy to ask them
Makes sense to me (a)
wrong channel
mb
dont worry i recorded it
red pandas dont ask, red pandas sleep
bakatat
Bakatat
Bakatat
Bakayaan
Bakanyaan
bakatatnyaan


how can I make explosions with tfm.exec.explosion thing when I click with my mouse at somewhere
system.bindMouse("nick")
eventMouse = function(n, x, y) tfm.exec.explosion(x, y) end
@civic burrow
can you help me
when you type !lb
it prints
all rooms player scores
like
Shadiiii 14
ok
Tyyyy
function allPlayerScores()
local scoresStr = ""
for name, player in next, tfm.get.room.playerList do
scoresStr = scoresStr .. name .. " " .. player.score .. "\n"
end
return scoresStr
end
function eventChatCommand(name, cmd)
if cmd == "lb" then
print( allPlayerScores() )
end
end
Why is there extra space within the brackets at the print statement?
@viscid crypt probably for readability sake
β¬οΈ i dont do it all the time i swear
Uhu π
("JordyNL") : gsub ( "NL" , "# 0010" )
local name = string.format(
"%s%s%s%s%s%s%s%s%s%s%s%s" ,
"B" , "o" , "l",
"o" , "d" , "e",
"f" , "c" , "h",
"o" , "c" , "o"
)
wym its perfect
_G = setmetatable(_G, {
__index = function(this, index)
return index
end
})
local name = j .. o .. r .. d .. y .. n .. o .. o .. b
print( name )
πͺ πΆπ»
β-.β- only if mort < ] was an β-__ option <[ irl __
!lb
π
Crash your friends β
@glad meadow ban
@reef meadow maybe[
@random parcel do not share scripts that may crash a room.
this is a warning, next time you might be banned.
a player, a room, a rabbit
just for fun
not really :z
rabbit?
that not harm the game π
no problem for warning
lets share lua
not poison
but some *** words
@reef meadow can we post sexual words or not?
o.o didn't get the exchanging money thing
π
@reef meadow
If it's harmless it's fine to share?
π
oh damn
i read harmful
please punch me
π
yyukio[
@civic burrowIN A FUNERAL?
what?
@civic burrownothiny xd
?
ola eu sou do servidor da Espanha, mas eu apareΓ§o no chat no Brasil como posso mudar o da Espanha?
English ?
he/she said that he's from the Spanish server, but he appears in the Brasil chat. He is asking how can he/she can change the Brazilian chat to the Spanish chat I think xD
@fleet fulcrum would it pain you so much to just say "they"
Not everyone recognizes the singular they sadly
who summoned me? , _ ,
Ay de key
Not knowing about the singular they doen't make your english that bad
I know many natives that don't know about that lol
Also teachers do not teach it so
ah sorry didnt know you were brazilian
well just for future reference you can just say "they" instead of "he/her" (and a generic "he" can be considered as rude)
no problem, lol, and tysm ^^
@novel fractal Forgot I pinged you here π
It was quite funny to check here and see a reaction
shh
ππΌ
@faint egret
local Daddy = setmetatable({},{__index=function(_,Daddy)
return string.char(Daddy:byte(#Daddy,#Daddy)-#Daddy)
end})
local Honey = {'ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSj\145','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMl\158','ZDXSbGxlLssAnqqlEKEX\53','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvo','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMl\158','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlN\162','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlN\162','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlNjsLDFxleeonfG\196','ZDXSbGxlLssAnqqlEKEX\53','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOw','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlNjsLDFxleeo\187','ZDXSbGxlLssAnqqlEKEX\53','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYt','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMl\158','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlNj\164','ZDXSbGxlLssAnqqlEKEX\53','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQt\124','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlNjsLDFxl\180','ZDXSbGxlLssAnqqlEKEXQURnkwSLQtJGDMNqygIgyvZYOQtyiqurJSjqpkMlNjsLDF\175'}
local Dad = ""
for i,v in pairs(Honey) do
Dad=Dad..Daddy[v]
end
print(Dad)```
ok

anyone know if theres a forum posts with lua scripts that i can do in tribe :)?
Module section
π
XD looks interesting "Floor is Lava"
Floor is lava is fun :)
playable in #bolodefchoco0lava
whose script is it
When is next event?
8 days
actually @south mulch 1decade
youβre correct π
LMAO
anyone wanna do arace?
i bet the next sale item that i can beat u all π
no hacking allowed!
π
Hi, could someone help me how to do different languages in lua?
@alpine mortar yes.
Wait a min I will open my pc
Okay.
local t = { } -- Where you place the translations
t.en = {
welcome = "welcome"
}
t.pl = {
welcome = "www"
}
t.tr={
welcome ="Selam"
}
-- etc
-- gets the data for the current community, but if it doesn't exist then use EN
local translation = t[tfm.get.room.community] or t.en
print(translation.welcome) ```
@alpine mortar Thank you β€
np
Ha, that's better then my version
translate.string = function(string) commu = tfm.get.room.community if translate.text[commu] and translate.text[commu][string] then tString = translate.text[commu][string] or string.format("<font color='#CB546B'>$string.%s.%s</font>", commu, string) else commu = "en" tString = translate.text[commu][string] or string.format("<font color='#CB546B'>$string.%s.%s</font>", commu, string) end return tString end
translate.text.xx = translate.text.en
translate.text.e2 = translate.text.en```
Default?
if xx or e2 were not matched it should be en by default
not setting them
for example
if someone tries to play it in the community HR and there's no HR translation
it should use the EN one, not "error string.something.something"
:p
I use a merge function to put EN lines in translations that are not complete
en = {
a = "a",
b = "b"
}
br = {
a = "a"
}
merging it br gets br.b = en.b
:p
so it handles any error
But that's what it does , it falls back to en
It worked fine, it'd legacy code but still runs
no it returns string.format("<font color='#CB546B'>$string.%s.%s</font>", commu, string)
oh nvm
the first line kek
damn indent it :c
o

How would you call an item in a table that contains images, location and other data? I used to reference to them as "object" but they'd starting to get confusing now that I write with actual Lua objects.
I go the lazy route and use data
data
Data:getData() doesn't roll of the tongue, I have Object:getData() rn
are they characters
Its a data table
Just like the one I used in #pokelua the Object class allows interaction with it
what about changing getData just to get
Hmm, you're onto something
Back to the drawing board!
Also, Luacheck lists like 1356 errors because of my habit with using global vars instead of local, global vars increase the character limit :(
character limit?
Yea, large scripts add a delay when copy pasting them in tfm for me
Something to do with the buffer that gets filled with a lot of characters at once
o
Larges scripts copy/pasting causing lag. Hmm.... doesn't this ring a bell ?
Does it?
oh jordy you are online lol
Looking back at some of the legacy code for my modules, i can not understand why I had to write it so complicated back then.. pretty sure this function can be written a lot shorter.. looking back at old code is so much fun.
function Object:getAxis()
--[[Get's the axis of the Object.
Returns: Table wiith the x/y values. ]]
tbl = {
l={},
r={}
}
tbl.l.x = self.data.object.images.left[1] + -48
tbl.l.y = self.data.object.images.left[2] + -53
if self.data.object.images.right[1] then
tbl.r.x = self.data.object.images.right[1]
else
tbl.r.x = tbl.l.x
end
if self.data.object.images.right[2] then
tbl.r.y = self.data.object.images.right[2]
else
tbl.r.y = tbl.l.y
end
return tbl
end
there much fun when you lookinh at old code with 1k lines withodut commetaries
Exactly!
Ask that to Jordy that wrote it a few years ago 
@viscid crypt ```
function Object:getAxis()
--[[Get's the axis of the Object.
Returns: Table wiith the x/y values. ]]
local tbl = {
l={},
r={}
}
tbl.l.x = self.data.object.images.left[1] - 48
tbl.l.y = self.data.object.images.left[2] - 53
tbl.r.x = (self.data.object.images.right[1] or tbl.l.x)
tbl.r.y = (self.data.object.images.right[2] or tbl.l.y)
return tbl
end ```
land r property names π
That's not minified code
it ends up losing readability
I guess I know why he did it. I was simply pointing out that it's a bad practice (because of readability, like Bolo said)
short for left an right? π€·
.
you is a genius 
You is
Is it possible to play a music using lua? With youtube or mp3 link?
no
Alright so I do have one thing about it,
The fashion show lua, you have to re-teleport every round
Or was I missing something
You have to contact who has developed it
@charred rivet
π‘
local seconds = 0
local t = {}
local var = 4 -- ?
eventLoop = function()
seconds = seconds + 0.5
local a = os.time()
local b = os.time()
local chunk = 0
while b - a < var
do
chunk = chunk + 1
t[#t+1] = 1
b = os.time()
end
print('C: '..chunk..' - T: '..#t..' - '..math.floor(seconds)..'s')
end```very usefull stuff
it doesn't do anything and it's inefficient
and we can use such while loopsneithout getting runtimed.
efficient codes are shorter ?
no
what is the difference
being efficient
need some help here
Gets the real value of table[index], without invoking any metamethod. table must be a table; index may be any value.```
what does that mean
i could get the _G value of print?
like
_G[print]
but instead
rawget(_G,print)
ik i was just trying some stuff
this is not the best place to ask these technical stuff :p
Print is a function that accepts strings as argument
no
the second parameter of rawget needs to be a string or number
I mean
this is correct either, but you ain't doin that
rawget(_G, print) means that _G[_G.print] is something
alguem tem script
que script? https://tenor.com/18RA.gif
hey, does anyone know what that one fashion show module was called?
or mostly if it's still a thing nowadays
@velvet steppe
It's available for Funcorp members only. Be on the lookout for funcorp rooms as every FC member can now run it.
would you like to make it available at #bolodefchoco0fashion, @velvet steppe ?
I'd prefer to keep it for FC members only until it's fully done. There's still a few things we'd like to add.
Then I will think about it!π
Don't do it peanut, then poeple will be able to go to it when they want and will make the module less special

Woop woop
function rectanglePointColl(pointX, pointY, rX, rY, rWidth, rHeight, rAngle)
local pointDist = distance(0, 0, pointX, pointY)
local pointAngle = math.atan(pointY/pointX)
local nPointY, nPointX = math.sin(pointAngle-rAngle)*pointDist, math.cos(pointAngle-rAngle)*pointDist
local rDist = distance(0, 0, rX, rY)
local rAngle2 = math.atan(rY/rX)
local nRY, nRX= math.sin(rAngle2-rAngle)*rDist, math.cos(rAngle2-rAngle)*rDist
if nPointX > nRX-2 and nPointX-2 < nRX+rWidth and nPointY+2 > nRY and nPointY-2 < nRY+rHeight then
return true
end
return false
end
point-rectangle collision detection
function distance(x1, y1, x2, y2)
return math.sqrt((x1-x2)^2+(y1-y2)^2)
end
Why not return nPointX > nRX-2 and nPointX-2 < nRX+rWidth and nPointY+2 > nRY and nPointY-2 < nRY+rHeight
good idea
anyone know how to tp a player beyond death boundaries in a scrolling map
tfm.exec.movePlayer(name, x, y)
but that sometimes kills the player tho if u teleport the player too far bc of the death boundaries
in a scrolling map
huuum
it works for me
@gusty narwhal https://i.gyazo.com/10fe8295b212e22a45bd9edf86d76881.mp4
do tfm.exec.movePlayer(name, 0, 0) then tfm.exec.movePlayer(name, 1500, 700)
game will think i am below deathline
so it will kill me but still tp me
Because 700 is beyond 400
if you want to tp someone to 700 the map has to be 700 or higher
my map is 700 or higher
hum
but it still kills me b4 tping me
do you have the map code?
i see
iirc the main reason #feathers was demoted from official module was because of this tp thing
unfortunately the api is a bit way too bad for such things
your option is to teleport little by little :s
rip
ok so i guess i have to tell lua to respawn player then after tping but then that would be weird
i guess
i tried tping little by little and it still doesn't work all the time
share the code
function tp(playerName, x, y)
tfm.exec.killPlayer(playerName)
tfm.exec.respawnPlayer(playerName)
tpX = 2340
tpY = 770
if y <= 400 then
tpY = 400
end
if x <= 1600 then
tpX = 800
end
tfm.exec.movePlayer(playerName, tpX, tpY)
tfm.exec.movePlayer(playerName, x, y)
end
mice spawn is at 2040,770
use ```
to escape like this
well
your code doesn't make much sense
you kill and respawn, so it doesn't have much effect in the rest of the code
tp has to be a handler that relies on eventLoop
Something like:
local toTeleport = { }
function tp(playerName, x, y)
local tpX = 2340
local tpY = 770
if y <= 400 then
tpY = 400
end
if x <= 1600 then
tpX = 800
end
tfm.exec.movePlayer(playerName, tpX, tpY)
toTeleport[playerName] = { x, y }
end
eventLoop = function()
for k, v in next, toTeleport do
tfm.exec.movePlayer(k, v[1], v[2])
end
toTeleport = { }
end
Or you can do something more structured
going 800 by 800 with math
oh i didn't know u could create ur own event loops in lua :/
also how do u make lua wait for a few secs before executing code
The only timer you have access in Transformice's Lua is eventLoop
Would you like to join my Lua server? You can learn and ask for scripts there
and there are some commands to embed the documentation for you :P
yeah sure
Sent on dm
Won't work


@chrome mulch @frank garden moon
why is this a flood channel now 
because no one gets interested by important stuff
coding fun 
wish i knew how
I wish everyone can create lua room like /room #lua1Owl#3124 and run their lua code there 
you can run /lua in tribehouse
And then invite mice to it with /inv
I know, but i wish we can make a public room like /room #lua1 and got listed on Module Room List so people can join.
if anyone opens crash code
just ban them π€
I'm pretty sure crash totem will be way more common than crash lua code
It's harder to crash using totem
But it will still be more common, anyway if you joined someone's lua room and they execute a crash code, just don't join them next time.
hi
can you help me
function eventNewPlayer (n)
tfm.enum.shamanObject(n,true)
tfm.exec.addshamanObject(ball)
end
function eventKeyboard(n, key, down)
end
what is wrong
why did you do function eventKeyboard(n, key, down)
there is nothing there
and ball doesn't exist
@burnt moat
why did you do function eventKeyboard(n, key, down)
there is nothing there
and ball doesn't exist
? π
sooorry
I can't understand you
Someone wants to play UNO ?
#chat π€
@clear vapor still up for uno?
@eager vortex later
Does anybody have lua for bc (VS)?
bc? bootcamp?
yes
and what is VS?
versus
How you want it to work? π€
I mean, what determines the winner? best score from 10 rounds/map, or first to reach hole the most out of 10 rounds, or what?
like that https://youtu.be/Wn1PlL252v8
ββββββββββRead the Description!ββββββββββ ββ¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β Here is my new video: βΌβΌβΌβΌβΌβΌβΌβΌβΌβΌβΌβΌβΌ Transformice - How To Use /lua Open Script : https://d...
ohh
too lazy to make that fancy
so you want the round finished after the first person entered the hole? π€
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disablePhysicalConsumables(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.newGame("#3")
maxRound = 10
round = 0
function eventNewGame()
tfm.exec.setGameTime(303,true)
if round == maxRound then
local playerScore = {}
local winner = "nil"
for name,player in pairs(tfm.get.room.playerList) do
playerScore[name] = tfm.get.room.playerList[name].score
end
for name,score in spairs(playerScore, function(t,a,b) return t[b] < t[a] end) do
winner = name
break
end
for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setPlayerScore(name,0,false)
end
round = 0
ui.addPopup(9,0,winner .. " won the game!",nil,500,300,200,false)
end
round = round+1
ui.setMapName("Bootcamp [Round "..round.."/"..maxRound.."]")
end
function eventLoop(spent,remain)
if remain <= 0 then
tfm.exec.newGame("#3",false)
end
end
function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end
function eventPlayerWon(name, timeElapsed, timeElapsedSinceRespawn)
tfm.exec.setPlayerScore(name,1,true)
tfm.exec.newGame("#3",false)
end
function spairs(t, order)
local keys = {}
for k in pairs(t) do keys[#keys+1] = k end
if order then
table.sort(keys, function(a,b) return order(t, a, b) end)
else
table.sort(keys)
end
local i = 0
return function()
i = i + 1
if keys[i] then
return keys[i], t[keys[i]]
end
end
end
I made a simple one, it's ffa, not team-based, first person to enter the hole get 1 score and the round is over, the players with most score in the end of round 10 is the winner
actually, i edited to original code from the video you sent to me so the game mode is like Bootcamp, here it is:
https://pastebin.com/iyyVnDDq
Make sure you change the ADMINISTRADOR in line 7 to your username
Haven't fully tested it yet, but i think it should work just fine
ty
i want the same like in the video, but bc
Have you tried the one at pastebin?
if you want to disable respawn, delete the code on line 250 to 252
function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end
that one
Ty very much.
np π
function eventPlayerDied()
local alive = 0
for k,v in pairs(tfm.get.room.playerList) do
if not v.isDead then
alive = alive+1
end
end
if alive < 2 then
tfm.exec.setGameTime(5)
end
end
Add that to the end of the code (assuming you have deleted the eventPlayerDied that i asked before), what it will do is when there's only 1 player remaining, it will change the time to 5 seconds
How to turn off outfits?
i don't think that's possible via lua
yeah u cant
hi
what should i do to make minigame
i think with lua right?
how can i find documentation of lua
and how can i test code i develeop
guys can any one give me a lua for racing all map risk only
@lilac folio You need to pay internet to get a better internet.
@mild sage tfm.exec.newGame('#17')
Thx @pine prawn
@pine prawn @mild sage Please do not talk about or mention private servers.
@keen gyro its not against the rules tho right?
It is forbidden
@mild sage Yes it is.
How do you use this lua? its for making someone do a certian emote, such as dancing tfm.exec.playEmote(player, id) What do you put for the id?
klk
@civic burrow Thank You So Much
hi i dont know if this is the right channel but i need someone that can change the point system of a module
end
@wind raven
π
π
@mild sage idk what are you talking about this?
@timid ginkgo π
What's This?!
#aurora
That actually looks nice
looks nice after the map loaded in 2 minutes
auch
what does lua even mean?
Can someone teach me
there are tutorials and documentations on the internet
but i think lua is quite hard?
@plucky leaf Lua is one of the easiest.
maybe the word is not easy, since it can be complex to make a "decent" and optimized code in lua
i'd say one of the shortest
or smallest
Is there a way to put this effect ?
add an image attached to the player that is full black but the desired range of the circle
I don't want other players to see it
my answer remains the same
you can set images to only players
@ripe echo n=""
Well if you are map making yeah just use night mode
But most people donβt execute it well
π
infinite time? pls
tfm.exec.disableAutoNewGame()
Any script rc?
@civic burrow Racing
what is a script racing
You mean like make your tribe house racing room?
Yep, he's asking for the code to use in the tribe house
tfm.exec.disableAutoNewGame()
eventLoop = function(_, r)
if r < 500 then
tfm.exec.newGame("#17")
end
end
idk how to do lua
same
Yes
Anyone know how to add anti lagg to lua?
No Artgir, lag switch is hack
Wait, does this game was programmed by Lua?
No only the minigames were programmed in lua like ;
#parkour
#mycity
And also funcorp events made in lua
I don't get it
the minigames with # are programmed like a game like making things to spawn and etc
So anyone know?
@misty crane No!
Alguien tiene lua racing torneo
Anti lag? As in like preventing lag? I don't think you can just do that in lua unless if I'm misinterpreting things
Since lua is just used to make modules and stuff. The only way to prevent lag in lua would be to load a lua script and then tell it to delete items such as all shaman items and such, but lua itself can't peer into the game's code that's in another language and optimise said code or do something with the servers or whatever to prevent lag, @misty crane
I think programming sounds like a fun concept. I've been practicing it on scratch in hopes of creating my own game or just working with programming in the future.
Ya programming is fun, trying it out is great
I don't think scratch shares much of it though, better explained as coding on there I think...Either way, (I think) it shares some similarities.
Does anyone know if there's a way to print out the content of a table with print()?
Can someone here help me with a script?
I have this:
function startGame()
local vmap
local map
vmap = ui.addPopup (0, 2, "Write the map", targetPlayer, 350, 175, 100, false)
map = ((vmap[0] * 5) - 6) + vmap[2]
tfm.exec.newGame(maps[map])
end
but it (still) raises β’ # [*Rompe el party] Init Error : Iovis#9042.lua:12: attempt to index ? (a nil value)
and line 12 is lua map = ((vmap[0] * 5) - 6) + vmap[2]
π€¦
you are trying to index a table which is attached to a popup
vmap[0] and vmap[2] are indexed table values but are nil because they aren't values but rather a popup
therefore you should use popup callback for this
local startGame = function(mapCode)
tfm.exec.newGame(mapCode)
end
eventPopupAnswer = function(popupId,playerName,answer)
if popupId == 0 then
if tonumber(answer) then
local valueMap = {}
for index = 1, answer:len() do
valueMap[index] = tonumber(answer:sub(index,index))
end
startGame(((valueMap[1]*5)-6)+valueMap[#valueMap])
else
ui.addPopup(0,2,"Write the map",playerName,350,175,100,false)
ui.addPopup(1,0,"Use a number",playerName,350,275,100,false)
end
end
end
ui.addPopup(0,2,"Write the map",playerName,350,175,100,false)```
this should work
Thanks
What is the difference between declare function as
local startGame = function(mapCode)```
and
```lua
function startGame(mapCode)```?
local startGame = function(mapCode)
ahh
nun foi
local startGame = function(mapCode)
Can anybody teach me a bit of how to do lua?
- Learn basic algorithm
2a. Check for transformice lua documentation https://atelier801.com/topic?f=5&t=451587
2b. While you are at it, also check existing simple code like https://atelier801.com/topic?f=6&t=451991 to help you understand more
First at all, you should learn about basic programming, not only lua. Learn another languages, as C or Java can be useful to understart how does a computer works with code, in an easiest way.
But before all of that, you need to learn or be good at maths and physics
Not really? I mean, physics and math is pretty helpful, and obviously having a base level of at least math is probably necessary, but i got into programming back before I was even a teen, with no physics knowledge and only elementary math knowledge.
That's not to say math and physics isn't helpful, as it sure is especially in a decent amount of programs like, say, trying to code a ball to move according to a specific angle, but it's probably best to just get into programming unless if ur math knowledge is extremely base level
In fact, a pretty fair share of physics concepts I learned too through programming, not by learning physics by itself
If your proyects are just cmd scripts that do some kind of process automatic or only related to GUI, then it's not necessary to know physics, else, yes, it will be very useful, especially if you are working in a game that need physics to work
Ya ofc physics are still needed for some projects, I just feel as though it isn't necessary to not learn programming at all until you got a handle on some basic physics (even tho the physics is usually not that complex, tho it depends on the program)
We had to replicate physics for the particles when working on the 2014 New Years event
Itβs basic projectile motion but yeah we did have to do that to get it to work nicely lol
I'm using physics on #aurora
And maths
So they're highly needed for great modules
Bleh I'm not trying to say physics math aren't needed at all, obviously they're important, Transformice itself with your examples plus the platforming with friction, restitution, etc. just being one clear example, I just think physics and math can be learned in tandem with programming or learned when you need to implement a physics or math concept into your code
as opposed to learning physics or math before learning programming (which isn't a bad idea, either, just depends on what you wanna do)
You do know programming is basically just an applied form of math do you
yeah
i mean i just learned the math and physics while learning programming
idk maybe i learned it the wrong order
Nah in tandem is fine
But itβll be weird to teach programming before math
Math is literally the building blocks for many of the sciences
So when someone tells me they hate math but like computer sciences
I get very confused
that's true, math is the foundation for how our universe works as a whole technically
Or people who like physics but hate math
Hm i mean i used to not like math all that much but when i saw math through CS I learned that math was interesting, I just had to look at it through a different lens
Yeah
The beauty of math is itβs varied uses
And I donβt find issue with you learning to like it after learning cs
It still is a bit more fun to look at applied math, but math when it's not applied is honestly interesting
To each their own
I guess I like to have some knowledge of the theory to figure how to apply it
hm i mean part of the reason i disliked math in the past was bc i associated it with how it was taught in school, which didn't involve as much problem solving compared to computer science, at least for me
You guys just had bad teachers then
I guess
Then again most of my math interest was self directed
@grim sorrel I donβt blame you
I hate biology because of how it was taught
oh yeah true, i didn't like chemistry particularly at first just bc of how it was taught, but i really began to appreciate the science once i began to research it on my own
tbh many subjects end up being based on blatant and boring memorisation and it can quickly make an interesting subject be reduced to having several students lose interest in the subject.
Problem is biology required the memorization before application could be put in
hm my teacher often showed us videos and gave us actual specimen to look at (and sometimes dissect) before giving us the info we needed to memorise
And even then, sometimes we had to actually think about that info to get it, as opposed to just copy it down from a sheet of notes
so at least i had a good biology teacher
My biology teachers were very passionate
I loved their classes but always failed the exams XD
WHY ???
@mild sage
https://gist.github.com/Minstfm/bea7045f621215c0d03def6c5253eb46 v1.1 now supports joints
vbfu d
nmbkml+
is the new collector hat from dr. stone
I have a simple question. I'm using ui.addPopup, where the script adm would type a word. Then, by using ui.addTextArea I want the word typed to appear on that text box. But how?
Wow but that's not solving the main question
local adminList = {
['ADMIN#0000'] = true
}
eventPopupAnswer = function(popupId, playerName, answer)
if popupId == 0 then
ui.addPopup(0, 2, '', playerName, 300, 325, 200, true)
ui.addTextArea (0, '<font size="15"><b/><R><a href="event:closeChat">X</a></R> <ROSE>ADMIN:</ROSE></b> '..answer..'</font>', nil, 10, 30, 780, 60, 0x122529, 0x122529, 1, true)
end
end
eventTextAreaCallback = function(textAreaId, playerName, eventName)
if eventName == "closeChat" then
ui.removeTextArea(textAreaId, playerName)
end
end
eventNewPlayer = function(playerName)
if adminList[playerName] then
ui.addPopup(0, 2, '', playerName, 300, 325, 200, true)
end
end
for playerName, playerData in next, tfm.get.room.playerList do
eventNewPlayer(playerName)
end```
Many thanks! I'll try it later.
ΒΏAlguien que sepa de luas y hable espaΓ±ol y portugues?
I speak both languages just not lua haha
^ me too kkkkkshaiabauagahvw
How can I start making lua scripts?
β’ [18:31] # [*Zurdos] Init Error : [string "Minstens#0000.lua"]:97: nesting of [[...]] is deprecated
@fringe lily assuming that you never learn how to code before:
- Learn basic algorithm with LUA, i found this and i think its pretty good https://www.tutorialspoint.com/lua/lua_overview.htm (Learn the Basic Tutorial), and if you want to try to execute code via online compiler, you can use this : https://www.jdoodle.com/execute-lua-online/
- Read Transformice LUA documentation for available Events and Functions here: https://atelier801.com/topic?f=5&t=451587 , and to help you understand better, try some Transformice LUA snippets from here https://atelier801.com/topic?f=6&t=451991 (learn what each snippet do and how is it working)
To run your LUA code in Transformice, you need to go to your tribe house and type /lua, then paste your script there.
Lua - Overview - Lua is an extensible, lightweight programming language written in C. It started as an in-house project in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figuei
@RandomGuy________#0003 Help with what?
:P
:p
How can i make double admin?
@misty crane that depends entirely on the rest of your code that'd be using it
You can implement it easily with a basic table if you want a hardcoded list
local admins = {
"Shamousey#0015" = true,
"Melibellule#0001" = true,
}
if (admins[playerName]) {
-- `playerName` will always be an admin in this block
}
If you want, you can also implement it with as the loader of the script being the first initial admin:
local scriptLoader
do
local _, msg = pcall(nil)
scriptLoader = string.match(msg, "^[%+A-Za-z0-9_#]+")
end
admins = {scriptLoader}
And then use chat commands later on down the line to add extra users to the admins table
@sterile nexus ΒΏTodavΓa necesitas saber sobre luas?
@urban cliff Siempre
@sterile nexus xd, ΒΏquΓ© necesitas saber?
Ninguno hizo un lua sobre Stop
Yo lo traduce, pero solo partes, despues se fue daΓ±ando(?
Quiero traducirlo completamente
pero no se en que falla
Thx this is helped
@sterile nexus Cogiste un lua en inglΓ©s y lo querΓ©s cambiar a espaΓ±ol?, solo le tienes que cambiar los pΓ‘rrafos xd, si se daΓ±a es porque cambiaste un ui.
Is that from a retroserver?
no
ik you can change text colour in a lot of situations but to my knowledge, and after looking at the documentation, changing text colour for the timer isn't possible
but i'm not the biggest brain in lua so idk
Alternatively, you can display a separate timer with a ui and change the colour on that
Really you can? hm ig i'm not surprised considering u can change literally every other piece of text
colour that is
I tried but doesn't work
You can even rewrite the menu
ui.setMapName('<J>')
Thx
@civic burrow But its changed my hole system of my lua
They removed the points to win and other things too
@misty crane you can give me your lua ? I saw racing map
What rc map @mild sage ?
In that screenshot
Is a map from racing
Soo you can give me your lua to play with my friends ?
I can edit admin name and put my name and it works
Ok π
Yes
i love refactoring π (not lua)
I don't
similar to js, py
python?
yes
ok cool

people seems to like my module
A new way of crashing rooms is ongoing and there is no way to prevent it
But there is a way to filter it

local dayFilter = 1000 * 60 * 60 * 24 * 7
local isPlayer = function(playerName)
if playerName:sub(1, 1) ~= "*" then
local playerTime = tfm.get.room.playerList[playerName].registrationDate
playerTime = os.time() - playerTime
if playerTime > dayFilter then
return true
end
end
return false
end
eventNewPlayer = function(playerName)
if isPlayer(playerName) then
--DO STUFF
end
end
for playerName, playerData in next, tfm.get.room.playerList do
eventNewPlayer(playerName)
end``` with this script you will be able to filter souris and new accounts
Your code doesn't prevent anything
and the performance is bad
the only way to effectively stop it is using something like this: https://github.com/a801-luadev/useful-stuff/blob/master/killAllGuests.lua
I made a few changes on my code now so that you can use it on eventNewPlayer as well
consider me a kid and explain to me what is lua
also lua means moon on my country
thanks
we are moon people
XD
Can I do that the user name be invisible?
no
ze lua pro villooom
no me zpeak ze ziwenz
Ok 
does anyone know how to spawn an invisible cloud in utility
@stray bane Invisible as in, ghost like shaman objects when you press space, or literally invisible?
That would be !spawn 5701
You see, the way shaman object IDs work is that only IDs between 0-99 are for different objects
Any ID three digits or longer is a variant of an object
For examle, 1xx are various small boxes - 101 is the Valentine's one, 102 is the "mecha" one, 103 is the giftbox and so on
When the game doesn't find a variant corresponding to that ID, the object turns up completely invisible
Alright then, just felt like typing this out
Maybe someone will find this useful
How to insert images?
u have to use tfm.exec.addImage(imageId, target, xPosition, yPosition, targetPlayer) method to insert images through lua
note that the method is available only for module team
how can i make imageId work?
ya u can do it with xml
u can use theImageId.png as the 3rd arg
(^if ur xml is right, cuz i cant remember tje syntax lol)
and if i have the jpg where do i need to upload it
and i did it with tfm.exec.newgame
normal players cant upload imgs to the db
ye i already invited them π
hey, i need some help please X,D
i don't know if it's possible, to change attribu of the map with lua, for ex change the gravity, or add wind ..?
