--SERVER
local loader = {}
local modules = {}
local unloaded = {}
local loaded = {}
function loader.new()
for i,v in (game:GetDescendants()) do
if v:IsA("ModuleScript") then
if v.Name ~= "PlayerModule" or v.Parent.Name ~= "PlayerModule" or v.Parent.Parent.Name ~= "PlayerModule" or v.Parent.Parent.Parent.Name ~= "PlayerModule" then
table.insert(unloaded, v)
table.insert(modules, v)
local suc, erm = pcall(function()
require(v)
end)
if not suc then
error("[".. v.Parent.Name.."."..v.Name.."] "..erm)
else
table.remove(unloaded, table.find(unloaded, v))
table.insert(loaded, v)
end
end
end
end
end
function loader:modules(isLoaded: boolean)
if isLoaded == true then
return loaded
elseif isLoaded == false then
return unloaded
else
return modules
end
end
return loader```
#Why does it say allat?
49 messages · Page 1 of 1 (latest)
I know it's because it is trying to require the default roblox modules but why? I have added checks to prevent that
i think it experienced an error while loading
Omg really?!?!
In a serverscript
just lua local loader = require(script.ModuleLoader) loader.new()
Because I have all my scripts as modulescripts
I just said why
usually this means that the model had an erorr in its code, check the code for the modules that didnt load
Well as you prolly can see, it's the default roblox playermodule
wdym
Nothing wrong with the modules themself
are you loading them from you module loader?
Look at the image
bro why are you loading them?
they are ment to laod for each player
when the player joins
It seems your loading em from the server
** You are now Level 7! **
Read the script.. I am trying to prevent them from getting required.
well they are still getting required
and they arent parnetd to the player
so they erorr
notice how it says the module in starterplayer is the one that failed to laod
load
so it isnt parented to a player which breaks the code
Thats my guess anyway
o i see what he means when he says, he aint loadin em
** You are now Level 13! **
bro dont do or
your are doing ort
you should do and
in your if condition
thats why they loadin
so do if something and something and something
so all these conditions will be met
other wise if you use "or"
it only means one of them should be met
change that
--SERVER
local loader = {}
local modules = {}
local unloaded = {}
local loaded = {}
function loader.new()
for i,v in (game:GetDescendants()) do
if v:IsA("ModuleScript") then
if v.Name ~= "PlayerModule" and v.Parent.Name ~= "PlayerModule" and v.Parent.Parent.Name ~= "PlayerModule" and v.Parent.Parent.Parent.Name ~= "PlayerModule" then
table.insert(unloaded, v)
table.insert(modules, v)
local suc, erm = pcall(function()
require(v)
end)
if not suc then
error("[".. v.Parent.Name.."."..v.Name.."] "..erm)
else
table.remove(unloaded, table.find(unloaded, v))
table.insert(loaded, v)
end
end
end
end
end
function loader:modules(isLoaded: boolean)
if isLoaded == true then
return loaded
elseif isLoaded == false then
return unloaded
else
return modules
end
end
return loader
here
this now shouldnt load em
@peak schooner
you there?
I went to bed. It was 11PM for me