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")

4 comments
Update: Same error occurs when testing it in the actual game
Local script or server script?
I don't think you spelt it right or its not in it. Try take a look in there when your playing in studio.
It's a server script, and I checked the spelling, it's correct. Even copied it from the original GUI. I am completely lost