Loading order and :WaitForChild("")

for my remote events I have it all organised into sub folders and I don’t know if I need to use waitforchild() everytime.
There’s some instances where I never need waitforchild like leaderstats’ descendants. I clone the leaderstats folder with all the children already inside so I never need waitforchild eg leaderstats.Cash, leaderstats.Gems
but for remote events in replicated storage I have Rep > Events> Pets > PetBought
so at the minute my code looks like

Rep:WaitForChild("Events"):WaitForChild("Pets"):WaitForChild("PetBought").OnServerEvent

but idk if the events folder gets added to replicated sdtorage with all the descendats already inside in which case I can do

Rep:WaitForChild("Events").Pets.PetBought.Onserverevent

or rep already has it in?

Rep.Events.Pets.PetBought.OnServerEvent

in the past I did have issues with events not loading in so Idk

Nope.:WaitForChild waits for descendants too. You only need to do it for the first one.
To clarify for any future viewers, it waits for the child it is searching for, which in turn means its descendants have loaded too.

1 Like

thanksss so much
charlimit charlimit charlimit charlimit

1 Like

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