Loading...
Loading...
Multi-place and multi-server games - universes and places, TeleportAsync with TeleportOptions (reserved/specific servers, teleport data), retrying failed teleports, secure access control, lobby-to-match flows, parties and queues, Roblox matchmaking with custom signals, server type detection, data handoff. Use when adding lobbies, match servers, dungeons, parties, server browsers, or customizing server selection.
npx skill4agent add el4cteo/roblox-skills roblox-teleport-matchmakingFully openLimited to same universeSecure within universe only--!strict
local TeleportService = game:GetService("TeleportService")
local ATTEMPTS = 5
local RETRY_DELAY = 1
local FLOOD_DELAY = 15
local function safeTeleport(placeId: number, players: { Player }, options: TeleportOptions?): (boolean, any)
local ok: boolean, result: any = false, nil
for _ = 1, ATTEMPTS do
ok, result = pcall(function()
return TeleportService:TeleportAsync(placeId, players, options)
end)
if ok then
break
end
task.wait(RETRY_DELAY)
end
if not ok then
warn("Teleport failed:", result)
end
return ok, result
end
-- A teleport can still fail after TeleportAsync succeeds: retry transient failures.
TeleportService.TeleportInitFailed:Connect(function(player, teleportResult, errorMessage, placeId, options)
if teleportResult == Enum.TeleportResult.Flooded then
task.wait(FLOOD_DELAY)
elseif teleportResult == Enum.TeleportResult.Failure then
task.wait(RETRY_DELAY)
else
warn(`Invalid teleport [{teleportResult.Name}]: {errorMessage}`)
return
end
safeTeleport(placeId, { player }, options)
end)
return safeTeleportTeleportOptionsShouldReserveServer = trueTeleportAsyncResultReservedServerAccessCodePrivateServerIdReservedServerAccessCode = codeReserveServerAsync(placeId)ServerInstanceId = jobIdSetTeleportData(table)player:GetJoinData().TeleportDataTeleportService:GetLocalPlayerTeleportData()PrivateServerIdTeleportTeleportToPlaceInstanceTeleportToPrivateServerTeleportPartyAsyncTeleportToSpawnByNameReserveServerTeleportAsyncTeleportOptionsReserveServerAsyncPrivateServerIdgame.PrivateServerIdTeleportService:SetTeleportGui(gui)ReplicatedFirst| Server | | |
|---|---|---|
| Public | | |
Reserved ( | non-empty | |
| Private (VIP) server | non-empty | owner's user id |
roblox-data-storesTeleportAsyncShouldReserveServer = truePrivateServerIdServerInstanceIdPlayerEloMatchmakingService:SetServerAttribute(name, value)GameModeServerLevelInitializeServerAttributesForStudiogame:BindToClosegame.JobId:restartServers{ jobId, players, mode }roblox-data-storesroblox-data-storesroblox-securityroblox-game-systemsroblox-open-cloud