Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

please help i am trying to get the players gui and it gives me a infinite yield?

i am trying to get the players gui but every time it says { Infinite yield possible on 'Players.tylergoatboy.PlayerGui:WaitForChild("screen")'} it it will not find it (i have waited for some time )

the script is in the workspace

game.Players.PlayerAdded:Connect(function(plr)
	local gui = plr.PlayerGui:WaitForChild('screen')
	if gui then 
		print('yes')
	end
end)

7 comments

0

in nowhere in the script does it say Players.tylergoatboy.PlayerGui, mayb try spcificying that into the "screen" part.

0

Is there a script anywhere that adds a ScreenGui called 'screen'?

0

1.that is my player and the stuff i what it to do can't be done in the gui 2.the screen is in startergui

0

Your writing needs Grammarly;) please be more careful about what you’re typing, I can barely understand a thing

0

I am pretty sure you have to wait for PlayerGui as well.

0

I just tried that and it did not work any other ideas?

0

Check the answers

3 answers

✓ Accepted answer

If Filtering Enabled is set to true, and the GUI was set by StarterGui, it is unable to reach the contents of the player's PlayerGui unless the serverscript cloned/parented the GUI itself.

Make sure to accept this answer.

2 comments

0

thanks

0

@tylergoatboy, don’t use ServerScripts to attempt on tampering with the Player final, it’s not meant to, use LocalScripts instead as it’s meant to be used for Local-based actions

If you're getting an error that says there's an infinite yield possible, that means that the game thinks that it could wait forever and never find the child called ('screen'), which leads me to believe you probably made a spelling error, or there's no such gui called 'screen'.

2 comments

0

Filtering Enabled is always set to true, so in this case, serverscripts cannot access the contents of the playergui if it wasn't cloned/parented by the serverscript itself.

0

ServerScripts can’t access the Player final, unless you use the GetPlayers() array loop method

ServerScripts, otherwise known as Scripts, cannot access the PlayerGui, more directly the Player or Client is other words itself, only a LocalScript can, it also will only run in specific places, the most common place is to have it inside of StarterPlayerScripts

Duplicate the Code into the LocalScript and put it where I asked, hope this works for you

This discussion is preserved as it was. New answers, comments, and votes are closed.