Help understanding ReservedServer

I’m currently reading ReservedServer, and I would like to understand the last part of following code sample from the article.

Code Sample

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()
 
-- Get the saved code
local code = DS:GetAsync("ReservedServer")
if type(code) ~= "string" then -- None saved, create one
	code = TS:ReserveServer(game.PlaceId)
	DS:SetAsync("ReservedServer",code)
end
 
local function Joined(plr)
	-- Everytime they chat, we want to know
	plr.Chatted:Connect(function(msg)
		if msg == "reserved" then -- Aha, that's our cue
			TS:TeleportToPrivateServer(game.PlaceId,code,{plr})
		end
	end)
end
 
-- Connect all current and future players
Players.PlayerAdded:Connect(Joined)
for k,v in pairs(Players:GetPlayers()) do
	Joined(v)
end

I want to understand the last part of the code where;

-- Connect all current and future players
Players.PlayerAdded:Connect(Joined)
for k,v in pairs(Players:GetPlayers()) do
	Joined(v)
end

Comment says all current and future players will be teleported, where it also says that when all players are teleported to Reserved Server the current server will be shut down, then how come the new joining player will be able to join the reserved server.

Question
If GlobalDataStore is being used then is that GlobalDataStore available throughout the current game.

Question
If GlobalDataStore is available throughout the game then all coming players will join the Reserved Server then what will happen when Reserved Server is full.

Question
Does Reserved Server support multiple places at a single time…

Thanks in advance…

The last part of your code is quite simple. When a player is added to the game, you go through the loop to get each player. You then call your function and using v, you send them to the private server.

2 Likes

May I ask for this private server how many people can it hold?

That’s my second question mentioned in the post.