I have many scripts that have the same function, but just with diffeernt parameters. I was thinking to create a module script so only 1 function would be used and so I wouldn’t repeat myself.
would look something like this.
– script 1
module.Function(24, true)
– script 2
module.Function(32,false)
– script 3
module.Function(10,true)
But the question is, I have many scripts. Around 20 that will have this same function, so I would just like to now if it is okay to require() the same module multiple times?
2 Likes
It should be ok as long as you don’t spam require. You only need to require once then you can use the functions and data of the module.
Could you explain what you mean by ‘spam’ require?
You mean like ??
while wait(5) do
local module = require(ble)
end
Like run it alot of times if.
this is bec i cant say short things
1 Like
that should be fine bec ur not doing it fast. i meant like 60 times a sec
ohhhhh. okay make snese. My module function is only used for the end of the round so no worries.
Thanks for the quick response!
No problem bro!
Almost every single front page game uses modules with 1000’s of lines of code. If they weren’t good then no one would use them.
1 Like