Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[True or false] How many times can a server script "require()" a module?

I was looking on the Wiki and I seen that you can only require a module once??

But.. then while I was looking at Usering's admin commands, I noticed that he could require() more then once..

local scripts = require(207311282)
local scale = require(210061734)

local preferences = require(script.Parent.Preferences)
local admins = require(script.Parent.Admins)
local banned = require(script.Parent.Banned)

local targetAllowance = require(script.Parent.TargetAllowance)

Are you able to require more then once ->"Yes" or "True"; or can you only require once "No" or "False".. I know this is a silly question, but I want a direct answer NOT from the script.. I want a true or false answer from a nother ROBLOX user.

1 comment

1

I believe you can only require each module once per script. As you can see, "Admins" and "Banned" are two different modules. You can use Require() more than once per script but I believe only once per module. I don't use ModuleScripts too often so I may not be correct.

1 answer

✓ Accepted answer

Yes, you can require a single module more than once in the same script..

This discussion is preserved as it was. New answers, comments, and votes are closed.