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

GetDescendants not getting all descendants?

Asked by 2 years ago

I have a script that needs to find all of the descendants of the workspace using the workspace:GetDescendants() command. For some reason, when I use a server script, the command only gives me some of the workspace's descendants. HOWEVER, when I tried it with a local script, workspace:GetDescendants() returned all of the descendants. Why is this? Is get descendants broken when used on the server side?

0
Are you immediately getting workspace's descendants? Chances are, the server script is running before *all* of the descendants are loaded. When it runs in the LocalScript, the **player** has to load in, and then the script will run which gives the descendants time to load. appxritixn 2235 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

The server script may be running before the character loads in, and the character is part of the workspace (and takes up a lot of descendants)

Check if the LocalScript runs after the character loads in. I've tested this for myself, and they both return the same thing.

0
Well, what I mean is that I have a many parts in some folders parented to workspace, and only some of them are being detected by getdescendants. This isn’t about the character Dr_Smartypants123 86 — 2y
0
Try changing where they are or getting them out of the work sapce and try merging them together Ilands_master222 17 — 2y
Ad

Answer this question