:WaitForChild() server/client

So guys I was just wondering, I think i’m right but sometimes i’m not so I guess i’ll just say it right here. I’m pretty sure you usually don’t need to use waitforchild on the server as everything has already been loaded correct? Waitforchild is mostly needed for the client because the client will replicate things from the server and also wouldn’t have loaded it in things yet such as things from the workspace or some guis.

1 Like

Yes that’s right on the server it’s redundant, on the client it’s necessary.

2 Likes

But I’m pretty sure that only preloads assets no? Actual objects/instances such as screenguis can’t be loaded with contentprovider right?

3 Likes

Why are these posts being deleted? Is something happening here?

1 Like

Yea. Nevertheless, you should still use :WaitForChild() if :Cloning()/Instancing is involved and the server needs that instance.

1 Like

True I got confused. So yeah just use :WaitForChild

1 Like

I’m just kinda sad that this topic of mine got more attention compared to some of the topics which I really needed help on.

1 Like

Those topics of yours never appeared on my latest tab.

1 Like

Is there anyway I can bring those topics back to life? They’re sorta dead now.

1 Like

you could try reposting them and make the title more ‘attention-grabbing’

Does roblox allow that to happen?

i have not seen anyone punished for reposting. you can delete your previous post and make a new one

Alright then thanks. I’ll do it.

Simple topics like this get more attention because people can more or less effortlessly answer. People can’t be bothered with the more complex stuff.
Also if you’re really desperate you could try posting at a time of day where the most users are online

It’s not even complex though. That’s the problem :frowning:

if you’re that desperate, then send the link here so i can view it and help with anything that is within my capability

The answer is: it depends.

Server already has everything in the datamodel loaded, so you don’t need to use WaitForChild unless the object is dynamically created by another script.

LocalScripts in their respective containers (such as StarterGui, StarterPlayerScripts, etc) only run after game.Loaded, which means the client has already received a snapshot of the datamodel. LocalScripts should also be able to access anything inside of their container without using WaitForChild, but if something in StarterGui attempted to access something in a different container like StarterPlayerScripts then you would probably need to use WaitForChild.

Essentially, if the object was already in the workspace at the beginning of the server then you don’t need to use WaitForChild on the client. The exception being if the server creates the object dynamically, the script is in ReplicatedFirst, or you’re using StreamingEnabled.

This reply pretty much sums it up perfectly: Player instance now created on server instead of client - #76 by Anaminus

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.