Can I rely on ReplicatedStorage Instances loading before PlayerScripts run?

It feels like this should be answered somewhere, but I cannot find it after searching for an hour, so here I go.

There’s lots of great posts relating to proper usage of WaitForChild and FindFirstChild, but I really want to know if WaitForChild is necessary in this specific case. Can I be certain that Instances I place inside ReplicatedStorage (not instances parented by a server script after the game starts) will be replicated to the client before PlayerScripts are run?

I’ve tested this by indexing a few Instances in ReplicatedStorage from a LocalScript and didn’t get any errors, but I want to be sure.

1 Like

Always utilize wait for child for client sided objects, because they tend to run before anything is added. Sometimes you also have to use wait for child for server objects, because somethimes they aren’t loaded in either.

Technically there are ways involving my system I use that you could get away with WaitForChild() not being required but even so I still use WaitForChild. if you’re like me and run 1 client script while the rest branch off into modules in a sort of FileSystem format in theory you could get away without relying on WaitForChild by instead linearly loading the UIs however this I do not recommend cause too much effort for 0 result. WaitForChild is always good practice if all you’re doing is wanting a constant index of a UI or a part or whatever. What I just said is what I’m seeing from my perspective, not a recommendation by any means. As long as you want this to be a constant object that should always be found in (Parent Object) then I would suggest WaitForChild() over anything else on the client.The server however may be another matter all together.

1 Like

contents of ReplicatedStorage are replicated before DataModel.Loaded fires.

:WaitForChild() is not necessary to be incorporated on the contents of ReplicatedStorage.

Go here:

11 Likes