Hi, I've been having a lot of trouble over the past days trying to figure this out but nothing is working. I've tried to look for understanding on what it means by infinite yield is possible, and I've tried so much, but nothing is working. Here is my script.
for i, player in pairs (game.Players:GetPlayers()) do player.PlayerGui:WaitForChild('playerInterface') end function Intermission(TextValue) for i, player in pairs (game.Players:GetPlayers()) do if player:FindFirstChild("PlayerGui") and player:FindFirstChild("PlayerGui"):FindFirstChild("playerInterface") then player.PlayerGui.playerInterface.intermission.Text = tostring(TextValue) end end
Whenever I dont put in the WaitForChild() the gui doesnt work, when I do put it in, an Infinite Yield comes up and the script itself entirely breaks. However, I found a solution, but then whenever I would be to reset my character, It would completely remove the GUI ( I used clone(). ) This is in a regular script.
Any help would be much appreciated, thank you for your time reading this.
"Infinite Yield". I found this kind of stuff difficult when I started, don't worry. Yield means kind of like a wait() statement. Basically it means Infinite wait. This means it can infinitely stop running because the WaitForChild() finds nothing. It does Yield the script after all. Make sure the player has an object in the PlayerGui named 'playerInterface'.