Hey also I just also realised what this single script architecture is for and just wanted to explain it better to you. Heres an article that explains it well.
this seems right let me try it
flkfv:
local Main = {}
Main.modules = {}
for i, module in pairs(script.Parent:GetDescendants()) do
if module:IsA("ModuleScript") then
table.insert(Main.modules, require(module))
end
end
return Main
local main = require(script.Parent.mainModuleScript)
local data = main.modules[1]
print(data)
it’s on the right path but it gives me an error and this is what I’m trying to do but I’m trying to figure out the error now the error involves modules requiring each other
lrisDev
(lrisDev)
June 11, 2021, 1:52am
#25
Mind sending the error, would help a bunch!
sure thing the error is:
Requested module experienced an error while loading - Server - Script:1
ive looked into it and they talk about it in this post
Seems roblox finally implemented an error case for when modulescripts require each other recursively. Previously it would just have scripts loop forever and cause a lot of headache when debugging.
(I made a post about this here: ModuleScript Require Deadlock needs an error message ).
Now that this change is added, a lot of older scripts and plugins that didn’t account for this require error log will now print it, even though in their cases the recursive require wasn’t something that broke the …
flkfv
(flkfv)
June 11, 2021, 1:56am
#27
It should print another error most times, is there any other errors other then just that?
@IrisDev ope sorry I gave the wrong error
Requested module was required recursively - Server - mainModuleScript:3
Nevermind fixed the problem I just manually required them all