I am not 100% certain, but I was looking to double check my idea that using GetChildren or GetDescendants will wait for all predefined items that are present during runtime (Meaning they exist in studio when we edit).
Here is an example of my code:
local serverModules = {}
for moduleName, module in pairs(serverStorage:WaitForChild("Modules"):GetDescendants()) do
if module:IsA("modulescript") then
serverModules[moduleName] = require(module)
end
end
When I call GetDescendants will it wait or get all the modules that exist before the game is ran and then add it to the serverModules table?
GetChildren and GetDescendents will get all the Children that currently exist in the Parent, on the Server, It will get the Objects because they already exist, while the Client will need to load in the objects. (Assuming thats what you’re asking)
Does that mean, that if they didn’t load in fast enough then they won’t be accounted for? And only the children or descendants that loaded fast enough will be accessed?
On the Server, No, as everything is already loaded there
But on the Client, Most Likely
(After trying to check the children in the workspace on the Client, under ReplicatedFirst, only the Camera existed, and nothing else eben after spawning a couple of parts, The Server had all of them, while the Client needed to load them in, so probably the case, But then again, doesnt always happen)
Curious is there any good articles you suggest reading about the game loading phase specifically the loading stages? Like ReplicatedFirst loads first etc…