Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 9 years ago

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
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. FearMeIAmLag 1161 — 9y

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

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

Ad

Answer this question