Why It Shows "Infinite Yield" Even If The Object Is There?

I am pretty disappointed with replies earlier in the thread, as it went pretty off-topic. I would like to say that, WaitForChild yields the thread till it finds the object, that being said you can use the second parameter in WaitForChild to wait only till a specific time.

You are probably getting that because there is a time when Loading Screen isn’t added to the PlayerGui yet, not a problem, it shouldn’t infinite yield as long as you have that referenced, and you can verify that by Checking if rest of the code works, (Just place a print statement after that.)


@FlamingGuards I would recommend you to not spread Misinformation, if you access the Player Gui, its All The GUI Objects which are cloned from StarterGui on Character Spawn. And If you try to edit StarterGui like this in localscripts, and think it will change for the Player it wont, you will need to edit the Player Gui instead.

local GUIs = game:GetService("StarterGui")
GUIs.TextLabel.Text = "BlaBla"

But something like this will work as you’re directly referencing the UI object

local TextLabel = script.Parent
TextLabel.Text ="BlaBla"

And this will also work

local TextLabel = game.Players.LocalPlayer.PlayerGui.TextLabel
TextLabel.Text = "BlaBla"
3 Likes