MaxPlayers = 10

Hi guys! How can I change the MaxPlayers on the server with a script? With manually I cannot do it, because the ,Access" bar didn’t show me up, when I want to publish the game. :confused:

I tried the:

game.Players.MaxPlayers = 20
and the
game.Players.PreferredPlayers = 20

But nothing :confused:

1 Like

Correct me if I’m wrong but there is no way to do it via code, you’d have to do it manually through the settings.

Develop > Click the gear icon on the place you want to edit > Configure Place > Access

5 Likes

You can’t change it via code.

2 Likes

The best you could do is set your max players to the highest you would ever want at 1 point in time, and then use code to kick anyone who joins the game if the playercount is over a set amount (a variable which you can change ingame)