el4cteo/roblox-skills

roblox-teleport-matchmaking

Multi-place and multi-server games - universes and places, TeleportAsync with TeleportOptions (ReservedServerId, VipServerId, specific servers, teleport data), retrying failed teleports, secure access control, lobby-to-match flows, parties and queues, Roblo…

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/el4cteo/roblox-skills --skill roblox-teleport-matchmaking

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Teleports, places, and matchmaking

Structure

  • A universe (experience) contains a start place plus sub-places. All places share DataStores,

MemoryStores, MessagingService, developer products, and passes.

  • Typical layouts: Lobby (start place) → Match place (reserved servers) → back to Lobby; or a hub with

separate world places. Keep shared code in packages or a shared Rojo tree.

  • Access Control for Places (Creator Dashboard): Fully open, Limited to same universe, or

`Secure within universe only` (only server-initiated teleports into non-start places — recommended for progression gates and test places). Clients can otherwise teleport themselves anywhere in the universe.

Teleporting (server)

luau
--!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 safeTeleport

TeleportOptions (set at most one of ReservedServerId, VipServerId, ServerInstanceId, or it errors):

  • ReservedServerId = HttpService:GenerateGUID(false) → a reserved server (private, developer-created)

— ideal for matches, dungeons, and parties. The first teleport with a new GUID creates the server; reusing the same GUID (store it in a DataStore/MemoryStore) sends more players to it. Generate GUIDs on the server. On arrival, game.PrivateServerId equals that GUID.

  • VipServerId = id → a player's VIP server (its game.PrivateServerId), usable with any place in the

experience. Carry the id in teleport data to keep a VIP group private across places (VIP → match → VIP); handle TeleportInitFailed (server closed, full, or player not allowed).

  • ServerInstanceId = jobId → a specific public server (e.g. "join friend's server").
  • SetTeleportData(table) → non-secure data readable on arrival with player:GetJoinData().TeleportData

(server) or TeleportService:GetLocalPlayerTeleportData() (client). Clients can tamper with it: never trust it for currency, items, or permissions — use DataStores/MemoryStores keyed by user ID or by the reserved server's PrivateServerId.

Deprecated: Teleport, TeleportToPlaceInstance, TeleportToPrivateServer, TeleportPartyAsync, TeleportToSpawnByName → TeleportAsync + TeleportOptions. ReserveServer/ReserveServerAsync, ShouldReserveServer, and ReservedServerAccessCode → ReservedServerId (old access codes still work).

luau
--!strict
local HttpService = game:GetService("HttpService")
local TeleportService = game:GetService("TeleportService")

-- New reserved match server; returns its id so more players can be sent later.
local function teleportToNewMatch(placeId: number, players: { Player }): string
	local serverId = HttpService:GenerateGUID(false)
	local options = Instance.new("TeleportOptions")
	options.ReservedServerId = serverId
	TeleportService:TeleportAsync(placeId, players, options)
	return serverId
end

return teleportToNewMatch

Data handoff between places

  1. Save the player's data before teleporting (ProfileStore: end the session / wait for save).
  2. The destination loads with session locking (ProfileStore retries while the old server releases).
  3. For match parameters (mode, map, team assignments), write a MemoryStore/DataStore entry keyed by

the reserved server's id (the ReservedServerId GUID) before teleporting; the match server reads game.PrivateServerId on start and loads its config.

  1. On arrival, TeleportService:SetTeleportGui(gui) (client, before teleport) keeps a loading screen

up across the transition; use ReplicatedFirst loading screens on arrival.

Testing teleports in Studio

TeleportAsync works in Studio Test and Team Test without publishing, for every supported teleport type and with no code changes. Studio tools (server view, Device Simulator, debugger) and MCP playtest automation carry over across the teleport. Its players parameter is typed {Player} under --!strict.

Detecting server type

Servergame.PrivateServerIdgame.PrivateServerOwnerId
Public""0
Reserved (ReservedServerId)non-empty (the GUID)0
Private (VIP) servernon-emptyowner's user id

game.ServerRegion is the IATA code of the hosting datacenter (e.g. "IAD", "SYD") for region-aware matchmaking and analytics.

Lobby → match flow

  1. Players queue in the lobby (party leader invites; party members stored server-side).
  2. Queue in a MemoryStoreQueue / sorted map by mode and rating (see roblox-data-stores), or use

Roblox matchmaking to fill public servers.

  1. When a match forms: generate a GUID, write match config to MemoryStore keyed by it, then TeleportAsync

all players with ReservedServerId = guid (the match server reads its config via game.PrivateServerId).

  1. Match server: waits for expected players (timeout), runs the round, saves results, teleports everyone

back to the lobby place (a public server, or the party's lobby via ServerInstanceId).

Roblox matchmaking (which server a joining player gets)

Default matchmaking scores eligible public servers by signals (friends, latency, language, age group, occupancy...) and picks the highest weighted sum. You can customize it per place in Creator Hub:

  • Adjust weights of Roblox signals, or add custom signals based on custom attributes:
  • Player attributes: values stored in a DataStore (e.g. PlayerElo), configured in the matchmaking settings.
  • Server attributes: set at runtime with MatchmakingService:SetServerAttribute(name, value) (e.g.

GameMode, ServerLevel); InitializeServerAttributesForStudio for testing.

  • Preview scores against mock servers before applying, then apply the configuration to places.

Use it for skill-based public servers; use reserved servers when you need exact team composition.

Server lifecycle

  • game:BindToClose for shutdown saves; game.JobId identifies the server; soft shutdowns after updates

(Open Cloud :restartServers or "Restart servers for updates") teleport players to fresh servers.

  • Server browsers: each server heartbeats { jobId, players, mode } into a MemoryStore sorted map

(TTL) — see roblox-data-stores.

Related skills

roblox-data-stores (session locking, MemoryStore queues), roblox-security (access control), roblox-game-systems (round loops), roblox-open-cloud (server restarts).

같은 저장소의 Skills

더 많은 Skills

모든 Skills
el4cteo
커뮤니티

roblox-architecture

Roblox project structure and client/server model - replication, where code and assets belong (ServerScriptService, ReplicatedStorage, StarterPlayer), RunContext, service/controller bootstrapping, player/character lifecycle, CollectionService components, attributes, streaming-safe client code, library choices. Use when starting a project, deciding where code goes, or fixing replication/streaming bugs.

1시간 설치 수
5
GitHub Stars
131
업데이트
11월 17일
el4cteo
커뮤니티

roblox-audio

Sound and music - the Audio API (AudioPlayer, AudioEmitter, AudioListener, AudioDeviceOutput, Wire, effects, faders), classic Sound/SoundGroup, 2D vs 3D audio, music and SFX volume, client vs server playback, asset permissions, streaming caveats, voice routing, text-to-speech. Use when adding music, sound effects, spatial audio, mixing, or fixing sounds that don't play.

1시간 설치 수
5
GitHub Stars
131
업데이트
11월 17일
el4cteo
커뮤니티

roblox-characters-animation

Characters and animation - Humanoid properties/states, spawning (LoadCharacterAsync), health and damage, HumanoidDescription appearance, Animator/AnimationTrack playback, priorities and markers, default animation replacement, Tools, TweenService, IKControl, Character Controller Library (beta). Use when changing movement, abilities, damage, respawn, avatars, animations, tweens, or tools/weapons.

1시간 설치 수
5
GitHub Stars
131
업데이트
11월 17일
el4cteo
커뮤니티

roblox-code-review

Review Roblox/Luau code for exploits, data loss, memory leaks, performance problems, lifecycle bugs, policy issues, and deprecated or superseded APIs, using a severity-ranked checklist and the full 2026 deprecation map. Use when reviewing a PR or script, auditing a game before launch, modernizing legacy code, or asked what is wrong with some Roblox code.

1시간 설치 수
5
GitHub Stars
131
업데이트
11월 17일