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)
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.
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'.
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