#Module runs multiple times when required multiple times
1 messages · Page 1 of 1 (latest)
barely any information here, but i see there's two prints every 0.1 seconds so i assume you required the module in two different places
Yes
I do require it twice
you aren't supposed to put code in a module script because it runs every time you require it
you can if you want but it's not recommended
think of a module script like a function, whenever you require it, its like running a function
I thought it runs once per environment?
nope
every time you require it, it runs again in a different environment. tables in the module script will also vary per require
I'm pretty sure they do not
plus, even roblox own docs say to use it to hold code that needs to be repeated. (DRY principle)
they.. do?
try it yourself
wait what
it only works in very specific cases
** You are now Level 1! **
it only outputs a single time
Imma see if I can see something related to this bug, because module script are supposed to only ran once
to be honest, It might be something with studio, try publishing the game and see what happens
it is published?