Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Find the max number of players? [ANSWERED]

I have some code to find out the max number of players. It says An error occurredon line 4. Do I have to specify the max number of players or can the server do that?

while true do
	wait()
	numplayers = game.Players.NumPlayers	
	maxplayers = game.Players.MaxPlayers
	
	script.Parent.Text = "Players in game: " ..numplayers.. " of " ..maxplayers
end

2 answers

✓ Accepted answer

Max player's is not a property in players so just make a player limit in Configure and let's 12 people is the limit

while true do
    wait()
    numplayers = game.Players.NumPlayers    
    maxplayers =  12

    script.Parent.Text = "Players in game: " ..numplayers.. " of " ..maxplayers
end

1 comment

0

That's what I ended up doing.

You can probably print it.

print(game.Players.NumPlayers)

@Hex's answer, I knew it!

2 comments

0

That's finding the number of players, I want the max number of players in a server.

0

Oh, there is no property of max players. So idk.

This discussion is preserved as it was. New answers, comments, and votes are closed.