Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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)
0
in nowhere in the script does it say Players.tylergoatboy.PlayerGui, mayb try spcificying that into the "screen" part. Adenandpuppy 87 — 6y
0
Is there a script anywhere that adds a ScreenGui called 'screen'? DaBrainlessOne 129 — 6y
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 tylergoatboy 82 — 6y
0
Your writing needs Grammarly;) please be more careful about what you’re typing, I can barely understand a thing Ziffixture 6913 — 6y
View all comments (3 more)
0
I am pretty sure you have to wait for PlayerGui as well. AbstractionsReality 98 — 6y
0
I just tried that and it did not work any other ideas? tylergoatboy 82 — 6y
0
Check the answers Ziffixture 6913 — 6y

3 answers

Log in to vote
0
Answered by 6 years ago

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.

0
thanks tylergoatboy 82 — 6y
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 Ziffixture 6913 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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

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. OutputErrors 40 — 6y
0
ServerScripts can’t access the Player final, unless you use the GetPlayers() array loop method Ziffixture 6913 — 6y
Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
6 years ago

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

Answer this question