How can I replicate/script Roblox's Server system?

Hey, I humbly ask, how can I replicate / script roblox’s server system in the way how when a server is full then a new server is generated:

How can I achieve this ? Would i have to create reservedservers , but then how would i even check if a server a player tries to join is full , et cetera, i’d appreciate if anyone can lay out a understandable way how to achieve this.

Thanks

i think that happens automatically
:roblox: or :roblox_light: does it for you

I mean in an actual game to script it

You cant, lol it’s simple. ROBLOX does this automatically, you cannot create a new server-ingame, unless you use teleportservice to a new reserved server, that may be a idea.

But this is scripting support, we don’t script stuff for you, we fix / help to fix your code. Not make it for you.

If you’re just talking about the website’s server system, Roblox does it automatically for you.
If you’re talking about in-game queuing, lobbies, or something else involving generating servers, try looking into creating a matchmaking system utilizing MessagingService, or HttpService if you’re looking for off-site hosting.

Yes regarding teleportservice, I didn’t ask anyone to script it for me, however i’d appreciate if someone could tell me the steps to do such as which functions of teleportservice to use

Thank you, yeah like generating servers in a game, so for example if i join a game lobby, then a private server displayed on the UI has a max player of 12/12 and if a player still clicks join despite it showing 12/12 how would feedback be sent to the player to let them know the server is full? Is there like a way to catch teleport-service feedback errors or something

For example (taken from the teleportservice hub page.)

local DataStoreService = game:GetService("DataStoreService")
local TeleportService = game:GetService("TeleportService")
 
local ServerAccessCodes = DataStoreService:GetDataStore("ReservedServerAccessCodes")

local teleportOptions = Instance.new(“TeleportOptions”)
teleportOptions.ShouldReserveServer = true
local teleportResult = TeleportService:TeleportAsync(game.PlaceId, {player}, teleportOptions)

ServerAccessCodes:SetAsync(teleportResult.PrivateServerId, teleportResult.ReservedServerAccessCode)

local accessCode = game.PrivateServerId ~= "" and ServerAccessCodes:GetAsync(game.PrivateServerId)

You can do a system like that or just read the teleprotservice API.
https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportAsync

Thank you very much, is it better to use datastoreservice to store the created servers or messagingserver to inform every server when one is created?

It really depends how your system would of been set up -
Messagingservice would be better, though datastore service can do the same job. :man_shrugging:

Thanks, and then if a player were to want to join a reserved server it’d have to be taken from the datastore right, however what if that particular reserved server is full? does roblox have like a feedback within teleportservice to let the server know that the teleport failed, so then if it failed i can maybe check the next available code to try teleporting them to. Is it " TeleportInitFailed" that returns if a server is full?