I made a local script to detect how many players are in the game, then put that on a text label. When I run it, it gives me “Game script timeout” on line 13. I do not understand. My script:
playerCount = game.Players.NumPlayers
if game.Players.NumPlayers >= 2 then
script.Parent.Text = game.Players.NumPlayers.." Players"
else
script.Parent.Text = game.Players.NumPlayers.." Player"
end
while true do
if game.Players.NumPlayers >= 2 then
script.Parent.Text = game.Players.NumPlayers.." Players"
else
script.Parent.Text = game.Players.NumPlayers.." Player"
end
end

7 comments
There
Sorry, there are indents in the actual code, IDK why not here.
because you have an infinite loop without a wait()
And NumPlayers isnt a valid property of the PlayersService
Yes it is
add a wait
you need to put a wait() at the end of the while true do