Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Find the max number of players? [ANSWERED]

Asked by 10 years ago

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

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago

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

0
That's what I ended up doing. CardboardRocks 215 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

You can probably print it.

print(game.Players.NumPlayers)

@Hex's answer, I knew it!

0
That's finding the number of players, I want the max number of players in a server. CardboardRocks 215 — 10y
0
Oh, there is no property of max players. So idk. Roboy5857 20 — 10y

Answer this question