Still have questions? Join our Discord server and get real time help.
0

# Infinite yield possible on 'Players.Player1.PlayerGui:WaitForChild("playerlist")' ?

Hi guys. So I've tried to make a custom playerlist which allows users to see who's in their game without using the old-school ROBLOX leaderboard.

When testing it solo in studio, the GUI pops up perfectly and displays the username, yet whenever I try to test it inside a Local Server, the error "Infinite yield possible on 'Players.Player1.PlayerGui:WaitForChild("playerlist")'" pops up every time, which tells me it basically waits for the playerlist to show up, even thought it isn't there.

When I check the PlayerGui inside the Local Server Client, I do find the GUI, but when I check the PlayerGui inside the Local Server host, neither of the test players have anything inside their PlayerGui.

How can I fix this?

This is literally the only part that somehow stops my game from working: (I added two WaitForChild's in there to be sure)

game.Players.PlayerAdded:Connect(function(plr)
local gui = plr:WaitForChild("PlayerGui"):WaitForChild("playerlist")

0
Update: Same error occurs when testing it in the actual game User#20989 0 — 2y
0
Local script or server script? Thepoint13 99 — 2y
0
I don't think you spelt it right or its not in it. Try take a look in there when your playing in studio. User#22722 20 — 2y
0
It's a server script, and I checked the spelling, it's correct. Even copied it from the original GUI. I am completely lost User#20989 0 — 2y