Lesson 4 of 5
A lobby place: reserved servers and teleports
Split Beacon Yard into a lobby place and a yard place, sending players to reserved servers with TeleportAsync, handling failures, and passing teleport data without trusting it.
By the end you can
- Describe an experience with a lobby place and a yard place, and what runs where
- Send a group to a reserved server with TeleportAsync and TeleportOptions.ReservedServerId, and handle failed teleports
- Pass TeleportData safely, re-read the truth on arrival, and secure access to non-start places
- Tell public, private and reserved servers apart, and give a private server's owner a command
Before this: ProfileStore: the library pros use, Security: never trust the client
Step 1 of 11
Every drill starts with whoever is in the server
Today Beacon Yard is one place. You join a server with strangers, and the drill starts when someone holds E at the beacon. There is no way to start a drill with your own group, no waiting room, and no way to put four friends in a yard of their own. Almost every session-based Roblox game solves this the same way: a lobby where players gather, and match servers they are sent to as a group.
The m11-two-places milestone builds this split inside Beacon Yard. Both places run the same codebase, and PlaceRole.luau checks game.PlaceId to decide whether a server boots as the Lobby or a Yard match.
What does a lobby plus reserved match servers give Beacon Yard that one place cannot?
Press 1 to 4 to choose, Enter to check.
Step 2 of 11
A campus of buildings
An experience (also called a universe) holds one or more places. The start place is where players land when they press Play. Every place runs as many separate servers as it needs.
The experience is a campus. Each place is a building: the Lobby building and the Yard building. Players walk in through the Lobby's front door, and a shuttle takes groups to the Yard.
Think of it as A campus of buildings
Server sideRemember: Experiences and places is a campus of buildings.
The campus picture breaks on numbers. A real building exists once. A Roblox place runs many copies at the same time, each with its own players and memory, and the copies do not know about each other. Two Lobby servers have two separate queues unless something shared joins them. That shared something is the next lesson.
Where does it break?“A campus of buildings” is a good picture of experiences and places. Where does it stop being true?
It breaks here. A campus has one copy of each building, but Roblox runs many copies of the same place at once, one per server, and those copies know nothing about each other.
The true model. An experience holds places. Every server runs its own copy of one place for the players on it. Servers share nothing unless the game uses a cross-server service such as DataStores or MessagingService.
Lobby server A has a Lua table of players waiting. What does Lobby server B see in that table?
Press 1 to 4 to choose, Enter to check.
Step 3 of 11
The shuttle: TeleportAsync
TeleportService:TeleportAsync(placeId, players, options) moves up to 50 players in one call, and only a server script may call it1. Without options, players go to a public server of the target place.
A reserved server is one that only your teleports can reach. You make the id yourself: generate a GUID with HttpService:GenerateGUID(false) and put it in TeleportOptions.ReservedServerId. The first teleport with a new id creates the server; later teleports with the same id join it2. The older ReserveServerAsync is deprecated and should not be used for new work1.
local TeleportService = game:GetService("TeleportService")
local HttpService = game:GetService("HttpService")
local function sendToYard(group: { Player })
local options = Instance.new("TeleportOptions")
options.ReservedServerId = HttpService:GenerateGUID(false)
options:SetTeleportData({ matchId = options.ReservedServerId, size = #group })
return pcall(TeleportService.TeleportAsync, TeleportService, Ids.YARD_PLACE_ID, group, options)
end
| In the picture | In Roblox |
|---|---|
| The shuttle | TeleportAsync |
| The ticket | TeleportOptions, with a ReservedServerId |
| The private room named on the ticket | A reserved server |
TeleportAsync is a shuttle with a ticket. The ReservedServerId on the ticket names the yard building's private room. Everyone with the same ticket ends up in the same room.
Think of it as A shuttle with a ticket
A 2021 tutorial calls TeleportService:ReserveServerAsync(placeId) and then TeleportToPrivateServer. What do you do today?
Press 1 to 4 to choose, Enter to check.
Step 4 of 11
Watch a group travel
The teleport flow
Goal Send a group of four to one reserved yard server, make one teleport fail, and retry it so the fourth player lands in the same server.

Two lobby servers, a yard place and a network. Queue players, press Start, and watch tickets, TeleportData and profile loads on the timeline.
Teleports fail like any network call. TeleportAsync can throw, so it goes in pcall and is retried a few times. It can also start, then fail at the last moment without throwing; TeleportService.TeleportInitFailed fires on the origin server with a result such as Flooded or Failure. Roblox's sample retries after a short wait, waits longer for Flooded, and gives up on invalid teleports2.
Match each teleport result to what the sample does.
Step 5 of 11
What travels with the ticket
TeleportOptions:SetTeleportData(table) sends a small table along. On arrival, the yard server reads it with player:GetJoinData().TeleportData. The docs warn that this data is not secure: it is visible to the client and not encrypted2. Coins, upgrades and anything a player could want to fake stay in the DataStore and are loaded again on arrival, exactly as they are today.
Server sideRemember: TeleportService is a shuttle with a ticket.
Where does it break?“A shuttle with a ticket” is a good picture of teleportservice. Where does it stop being true?
It breaks here. Nobody checks the ticket: teleport data passes through the client, so treat it as a hint and reload the truth on arrival.
The true model. TeleportService:TeleportAsync moves up to 50 players per call from a server script. A GUID in TeleportOptions.ReservedServerId creates or joins a reserved server. TeleportData is visible to the client and not encrypted.
A real shuttle ticket is checked by the driver. Teleport data is checked by nobody. Treat it as a hint ("this player came for match 7f3c"), validate its shape, and decide nothing from it that a player could profit from faking.
local session = playerStore:StartSessionAsync(profileKey(player.UserId), {
Cancel = function()
return player.Parent ~= Players
end,
})
A player arrives in the yard with TeleportData { coins = 99999 }. What does the yard server do?
Press 1 to 4 to choose, Enter to check.
Step 6 of 11
Lock the side doors
If players can join the Yard place directly, they can skip the lobby. The Access Control for Places setting decides that. Secure within universe only lets players reach non-start places only through teleports started by your servers, which suits places that only use reserved servers2. The client-side TeleportService:Teleport() is deprecated; every teleport in Beacon Yard starts on the server after a check.
Teleports between places in the same experience can be tested in Studio with Test and Team Test: the destination opens as another test server. In Test mode, PrivateServerId and JobId are empty. Teleports to VIP servers fail in Studio tests. In Team Test, the destination's game.PrivateServerId can differ from the ReservedServerId you supplied. Reuse the original ReservedServerId to send more players to the same server2.
Which Access Control for Places setting fits a Yard place that players should only reach from the lobby?
Press 1 to 4 to choose, Enter to check.
Step 7 of 11
Other shapes, and what studios use
Other ways pros do this
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| One place with rounds | Everyone plays in the server they joined, like Beacon Yard today. | Drop-in games, small player counts, a first release. | No parties or matchmaking; strangers share every round. |
| Lobby plus reserved servers | Players gather in the start place and are teleported as groups to reserved match servers. | Most session-based games: shooters, survival rounds, obbies with parties. | Two places to build and publish, teleport failures to handle, data must be saved before every move. |
| Teleport to public servers | Send players to any public server of another place, or a specific one by ServerInstanceId. | Hubs that link worlds, such as a city with several districts. | No control over who else is there. |
| VIP (private) servers | Servers a player buys or is given, identified by PrivateServerId. | Players who want to play with friends only; a monetization option. | Owned by players, not you; teleports to them fail in Team Test. |
Put the lobby's steps in order for a safe teleport.
- Make sure each profile is saved and the session can be handed over
- On arrival, the yard loads each profile from the DataStore
- Call TeleportAsync inside pcall, retrying on failure
- Form a group of players from the queue
- Generate a ReservedServerId and build TeleportOptions
Step 8 of 11
Build along: two places
The m11-two-places milestone is tagged, so you can compare your work with git diff m10-memory m11-two-places.
Build along
src/shared/PlaceRole.luausrc/shared/Ids.luausrc/server/LobbyBuilder.luausrc/server/QueueService.luausrc/server/MatchService.luau
In Studio, open your published test experience and choose File > Publish As, pick that experience, and select Add as a new place then Create to add the Yard place. Verify both places appear under Places In Experience in Asset Manager.
You should see Creator Hub and Asset Manager's Places In Experience list two places under your test experience: the start place (Lobby) and Yard.
Copy each place's id from Creator Hub and add
PLACE_ID(the Lobby start place) andYARD_PLACE_ID(the Yard match place) toIds.luauat 0, with your real ids only inIds.local.luau. Addsrc/shared/PlaceRole.luausoinit.server.luaupicks Lobby or Match fromgame.PlaceId.You should see Ids.luau has PLACE_ID and YARD_PLACE_ID at 0; your real ids are in Ids.local.luau.
Add
src/server/LobbyBuilder.luauandsrc/server/QueueService.luauusing the retry pattern aroundTeleportService:TeleportAsync. The real flow is not one server calling it with a GUID of its own: the matcher makes the GUID and publishes it over MessagingService, and every lobby server then setsoptions.ReservedServerIdto that same id for its own players. It needs non-zeroPLACE_IDandYARD_PLACE_ID, for the published match flow. In Studio's Test mode a teleport can open the destination as a test server, so you can try theTeleportAsynccall alone. Test the whole match flow on the published Lobby.You should see With both place ids set, QueueService sends matched players to one Yard server. With them at 0, the queue prompt says Matches are off.
Add
src/server/MatchService.luauto read and validateplayer:GetJoinData().TeleportDatawithMatchRules.expectedPlayers, start the drill once the group arrives, and send players back toIds.PLACE_IDwhen the drill ends.You should see In the yard server, MatchService reads expected player count from GetJoinData().TeleportData through MatchRules, and coins still come from DataService.
Step 9 of 11
Private servers and an owner's command
A private server (the docs also say VIP server) is a server of your experience that one player owns and invites friends into. You switch them on in the Creator Hub under Audience ⟩ Access Settings ⟩ Allow private servers, free or for a monthly Robux price. The experience must be public, private servers cannot be combined with paid access, and players under 13 may be kept out by their parental settings3.
A private server starts in the start place, so in Beacon Yard it is a private lobby. Your code tells the three kinds of server apart with two properties of game4:
PrivateServerIdis an empty string on a public server, and not empty on a private or a reserved server.PrivateServerOwnerIdis the owner's UserId on a private server, and 0 on a public or reserved server. The yard matches are reserved servers, so they have an id but no owner.
An owner perk fits here: in a private lobby, the owner types /drill and everyone in the server goes straight to a fresh yard match, without waiting in the shared queue.
-- src/server/PrivateDrill.luau, started only when PlaceRole is Lobby
function PrivateDrill.start()
local owner = game.PrivateServerOwnerId
if game.PrivateServerId == "" or owner == 0 then
return -- public lobby: no owner, no command
end
local command = Instance.new("TextChatCommand")
command.Name = "DrillCommand"
command.PrimaryAlias = "/drill"
command.Parent = TextChatService
command.Triggered:Connect(function(source: TextSource, _message: string)
if source.UserId ~= owner then
return -- only the owner may start it
end
local everyone = Players:GetPlayers()
local options = Instance.new("TeleportOptions")
options.ReservedServerId = HttpService:GenerateGUID(false)
options:SetTeleportData({ expected = #everyone })
local ok, err = pcall(function()
return TeleportService:TeleportAsync(Ids.YARD_PLACE_ID, everyone, options)
end)
if not ok then
warn("[PrivateDrill] teleport failed: " .. tostring(err))
end
end)
end
Build along
src/server/PrivateDrill.luausrc/server/init.server.luau
In the Creator Hub, open the experience, go to Audience ⟩ Access Settings, switch on Allow private servers, leave it free, and save.
You should see The Access Settings page shows Allow private servers on, with the price set to Free.
Add
PrivateDrill.luauwith the block above plus theGetServicelines and theIdsrequire, and callPrivateDrill.start()in theLobbybranch ofinit.server.luau.You should see In a Studio test, which is a public server, no DrillCommand appears under TextChatService and Output shows no PrivateDrill warnings.
Publish, create a private server from the experience page, invite a second account and try
/drillfrom each.You should see In your private server, typing /drill sends you and your friend to the same yard match; when your friend types it, nothing happens.
Someone starts PrivateDrill in every place, not just the lobby, and shortens the guard to check only PrivateServerId. What happens in a yard match, which is a reserved server?
if game.PrivateServerId == "" then
return
end
Press 1 to 4 to choose, Enter to check.
Step 10 of 11
Challenges
Level 2, Builder
Challenge
Build a party pad in the lobby that sends a group to one yard.
- Start from
- The game at milestone m11 (download)
Done means
- Four players who stand on the lobby pad together are sent to the same reserved yard server
- If one teleport fails, that player is retried into the same ReservedServerId
- A player who is not on the pad is not sent
Meet the criteria above, then record your own result. No test grades this check.
Level 3, Professional
Challenge
Write the lobby's rules as pure functions in the learner file. Start from the m14-ship tag in the game repo. The solution is challenges/solutions/lobby-and-teleport.md.
- Start from
- The game at milestone m14 (download)
- Grade it
- In Studio, press Play, then run
game.ServerScriptService.RunGameTests:Invoke("lobby-and-teleport", "lobby-teleport-rules")in the server command bar. Copy the pass code from Output.
Done means
- challenges/work/teleport_data.luau validates TeleportData into a match id or nil: a table with a matchId string of 1 to 64 characters, letters, digits and dashes only (so an empty string, 65 characters or "x; DROP" gives nil)
- It splits a group into batches of at most 50 players
- It says which TeleportResult names should be retried
- challenges/lobby-and-teleport.luau prints TEST PASS for every check
A lobby event sends 72 players to one reserved yard. How many TeleportAsync calls does it need at minimum?
Step 11 of 11
Recap
Retiring the analogy
You no longer need “a shuttle with a ticket”. TeleportService:TeleportAsync moves up to 50 players per call from a server script. A GUID in TeleportOptions.ReservedServerId creates or joins a reserved server. TeleportData is visible to the client and not encrypted.
Recap
- An experience holds places, and each place runs many independent servers; the lobby is the start place and the yard runs reserved servers.
- TeleportAsync (server only, 50 players per call) with TeleportOptions.ReservedServerId set to a GUID creates or joins a reserved server; ReserveServerAsync is deprecated.
- TeleportData is visible to the client: validate it, reload real data on arrival, retry failures, and lock the yard with Secure within universe only.
- Private servers are switched on in Access Settings; PrivateServerOwnerId is the owner's UserId on a private server and 0 on public and reserved ones, so owner perks check it.
Experiences and places is a campus of buildings, until a campus has one copy of each building, but Roblox runs many copies of the same place at once, one per server, and those copies know nothing about each other.
TeleportService is a shuttle with a ticket, until nobody checks the ticket: teleport data passes through the client, so treat it as a hint and reload the truth on arrival.
Queued for review
- Lobby server A has a Lua table of players waiting. What does Lobby server B see in that table?
- A 2021 tutorial calls TeleportService:ReserveServerAsync(placeId) and then TeleportToPrivateServer. What do you do today?
- A player arrives in the yard with TeleportData { coins = 99999 }. What does the yard server do?
Next MemoryStore and MessagingService: matchmaking across servers