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")
Do what you need to do in a LocalScript instead, or create the gui from the server. Right now the Gui only exists in the PlayerGui on the client. If you create the Gui from the server instead it should work, or if you just use a LocalScript it should work.