#Why does it say allat?

49 messages · Page 1 of 1 (latest)

peak schooner
#
--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```
#

I know it's because it is trying to require the default roblox modules but why? I have added checks to prevent that

rose lintel
#

i think it experienced an error while loadingsackboyshocked

peak schooner
#

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

civic kindle
#

usually this means that the model had an erorr in its code, check the code for the modules that didnt load

peak schooner
#

Well as you prolly can see, it's the default roblox playermodule

civic kindle
#

o shi really

#

did you modify it or

peak schooner
#

No

#

It just doesn't wanna require from my moduleloader

civic kindle
#

wdym

peak schooner
#

Nothing wrong with the modules themself

civic kindle
#

are you loading them from you module loader?

peak schooner
#

Look at the image

civic kindle
#

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

tiny gladeBOT
#

studio** You are now Level 7! **studio

peak schooner
civic kindle
#

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

tiny gladeBOT
#

studio** You are now Level 13! **studio

civic kindle
#

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?

peak schooner