WaitForChid is not a valid member of PlayerGui
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChid("ScreenGui2")
WaitForChid is not a valid member of PlayerGui
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChid("ScreenGui2")
Im pretty sure Child is spelt as Child not Chid
You mispelled WaitForChild, its written WaitForChid
Other thing is that you might use the second parameter of waitforchild which is the ammount of time it needs to wait so it can stop waiting for the child, in some cases if you dont put this , the game will say screenGUI aint a child of playerGUI
So basically you can put some time in it like WaitForChild(âScreenGuiâ, 20) (So basically this will wait for the child for 20 seconds if it doesnt appear during that time then it will say its not a member)
If you donât specify the second argument, all youâll get is an infinite yield error - it wonât ever under normal circumstances index quicker then âscreenGuiâ would take to exist or anything, and youâll just be yielding until the error shows up (you wonât get a âis not a valid memberâ or âchild ofâ error).
In most cases itâs just fine to not specify how long you want it to yield for if youâre sure the object is to exist sometime in the future at all.
Actually no, I used the waitforchild in some GUIs and items (and the child i was waiting for was already there) but it still said infinite yield.
But itâs just a safety thing
I donât believe you get what I meant,
the infinite yield error is something else, and a âis not a valid member ofâ error is something else, so you wonât get this error by not specifying the second parameter:
On another note,
Already where? It takes time for instances to replicate for every client
Edit:
Unless from replicated first, donât call ReplicatedStorage:WaitForChild(), there are several posts explaining the why.
Youâll get the error only if instances just take a bit more than 5 seconds to exist, thereâs so many reasons why that could happen.
It was at the studio already, I tested in workspace, replicated storage and starterGUI and they all did the infinite yield error until i specified the 2nd parameter.
But as I said it is for safety.