# TeleportService

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Service
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/TeleportService/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/TeleportService

Enables transporting [`Players`](https://rapi.sleaze.dev/classes/Players.md) between places and servers. For more information on how to teleport players between servers, see [Teleport between places](https://create.roblox.com/docs/projects/teleport).

## Properties

### CustomizedTeleportUI

```luau
TeleportService.CustomizedTeleportUI: boolean
```

- Tags: Deprecated, Not replicated, Read capabilities: Teleport, Load only

**Deprecated:** This item is deprecated since the default message it controls has been removed. Do not use it for new work.

No longer functional.

## Methods

### Block

```luau
TeleportService:Block()
```

- Tags: Roblox script security, Capabilities: Teleport

### GetArrivingTeleportGui

```luau
TeleportService:GetArrivingTeleportGui(): Instance
```

- Tags: Capabilities: Teleport + UI

Returns the *customLoadingScreen* the `LocalPlayer` arrived into the place with.

Returns: The *customLoadingScreen* the `LocalPlayer` arrived into the place with.

### GetLocalPlayerTeleportData

```luau
TeleportService:GetLocalPlayerTeleportData(): any
```

- Tags: Capabilities: Teleport

Returns the *teleportData* the [`Players.LocalPlayer`](https://rapi.sleaze.dev/classes/Players.md) arrived into the place with.

Returns: The teleport data the [`Players.LocalPlayer`](https://rapi.sleaze.dev/classes/Players.md) arrived into the place with.

### GetPlayerPlaceInstanceAsync

```luau
TeleportService:GetPlayerPlaceInstanceAsync(userId: User): ...any
```

- Tags: Yields, Capabilities: Teleport

Returns the `PlaceId` and `JobId` of the server the user with the given `UserId` is in provided it is in the same game as the current place.

Parameters:

- `userId`: The [`Player.UserId`](https://rapi.sleaze.dev/classes/Player.md) of the [`Player`](https://rapi.sleaze.dev/classes/Player.md).

Returns: See the table above.

### GetTeleportSetting

```luau
TeleportService:GetTeleportSetting(setting: string): any
```

- Tags: Capabilities: Teleport

Retrieves a teleport setting saved using [`TeleportService:SetTeleportSetting()`](https://rapi.sleaze.dev/classes/TeleportService.md) using the given key.

Parameters:

- `setting`: The key the value was stored under using [`TeleportService:SetTeleportSetting()`](https://rapi.sleaze.dev/classes/TeleportService.md).

Returns: The value stored under the given key.

### GetThirdPartyTeleportInfo

```luau
TeleportService:GetThirdPartyTeleportInfo(goForth: boolean): ...any
```

- Tags: Roblox script security, Capabilities: Teleport

### PromptExperienceDetailsAsync

```luau
TeleportService:PromptExperienceDetailsAsync(player: Player, universeId: number): Enum.PromptExperienceDetailsResult
```

- Tags: Yields, Capabilities: Teleport

Prompts a [`Player`](https://rapi.sleaze.dev/classes/Player.md) with information about the specified experience. The player can choose to teleport to the target experience through the prompt.

Parameters:

- `player`: The [`Player`](https://rapi.sleaze.dev/classes/Player.md) to be presented the prompt.
- `universeId`: `DataModel.UniverseId` of the experience to be presented to the [`Player`](https://rapi.sleaze.dev/classes/Player.md).

Returns: `PromptExperienceDetailsResult`

### PromptExperienceDetailsCompleted

```luau
TeleportService:PromptExperienceDetailsCompleted(resultEnum: Enum.PromptExperienceDetailsResult, errorMessage: string? = "")
```

- Tags: Roblox script security, Capabilities: Teleport

### ReserveServerAsync

```luau
TeleportService:ReserveServerAsync(placeId: number): ...any
```

- Tags: Yields, Capabilities: Teleport

Returns an access code that can be used to teleport players to a reserved server, along with the [`DataModel.PrivateServerId`](https://rapi.sleaze.dev/classes/DataModel.md) for it.

Parameters:

- `placeId`: The [`DataModel.PlaceId`](https://rapi.sleaze.dev/classes/DataModel.md) of the place the reserved server is being created for.

Returns: The server access code required by [`TeleportService:TeleportToPrivateServer()`](https://rapi.sleaze.dev/classes/TeleportService.md) and the [`DataModel.PrivateServerId`](https://rapi.sleaze.dev/classes/DataModel.md) for the reserved server.

### SetTeleportGui

```luau
TeleportService:SetTeleportGui(gui: Instance)
```

- Tags: Capabilities: Teleport + UI

Sets the custom `teleport GUI` that will be shown to the local user during teleportation, prior to the teleport being invoked.

Parameters:

- `gui`: The loading [`ScreenGui`](https://rapi.sleaze.dev/classes/ScreenGui.md) that is to be displayed during teleportation.

### SetTeleportSetting

```luau
TeleportService:SetTeleportSetting(setting: string, value: any)
```

- Tags: Capabilities: Teleport

Stores a value under a given key that persists across all teleportations in the same game.

Parameters:

- `setting`: The key to store the *value* under. This key can be used to retrieve the value using [`TeleportService:GetTeleportSetting()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `value`: The value to store.

### Teleport

```luau
TeleportService:Teleport(placeId: number, player: Instance? = nil, teleportData: any, customLoadingScreen: Instance? = nil)
```

- Tags: Capabilities: Teleport + UI

Teleports a [`Player`](https://rapi.sleaze.dev/classes/Player.md) to the place associated with the given `placeId`.

Parameters:

- `placeId`: The ID of the place to teleport to.
- `player`: The [`Player`](https://rapi.sleaze.dev/classes/Player.md) to teleport, if this function is being called from the client this defaults to the [`Players.LocalPlayer`](https://rapi.sleaze.dev/classes/Players.md).
- `teleportData`: Optional data to be passed to the destination place. Can be retrieved using [`TeleportService:GetLocalPlayerTeleportData()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `customLoadingScreen`: Optional custom loading screen to be placed in the [`CoreGui`](https://rapi.sleaze.dev/classes/CoreGui.md) at the destination place. Can be retrieved using [`TeleportService:GetArrivingTeleportGui()`](https://rapi.sleaze.dev/classes/TeleportService.md).

### TeleportAsync

```luau
TeleportService:TeleportAsync(placeId: number, players: { Instance }, teleportOptions: Instance? = nil): Instance
```

- Tags: Yields, Capabilities: Teleport + UI

The all-encompassing method to teleport a player or group of players from one server to another.

Parameters:

- `placeId`: The place ID the player(s) should be teleported to.
- `players`: An array of the player(s) to teleport.
- `teleportOptions`: An optional [`TeleportOptions`](https://rapi.sleaze.dev/classes/TeleportOptions.md) object containing additional arguments to the [`TeleportService:TeleportAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md) call. If this is not passed, no result will be returned.

Returns: If a [`TeleportOptions`](https://rapi.sleaze.dev/classes/TeleportOptions.md) parameter is passed, this will be a [`TeleportAsyncResult`](https://rapi.sleaze.dev/classes/TeleportAsyncResult.md) object that provides information about the final teleport destination.

### TeleportCancel

```luau
TeleportService:TeleportCancel()
```

- Tags: Roblox script security, Capabilities: Teleport

### TeleportedPlacesBackHistory

```luau
TeleportService:TeleportedPlacesBackHistory(): { any }
```

- Tags: Roblox script security, Capabilities: Teleport

### TeleportedUniversesBackHistory

```luau
TeleportService:TeleportedUniversesBackHistory(): { any }
```

- Tags: Roblox script security, Capabilities: Teleport

### TeleportReconnect

```luau
TeleportService:TeleportReconnect()
```

- Tags: Roblox script security, Capabilities: Teleport

### TeleportSwitchServer

```luau
TeleportService:TeleportSwitchServer(gameIdsToExclude: { any }? = {})
```

- Tags: Roblox script security, Capabilities: Teleport

### TeleportTrustedBackForth

```luau
TeleportService:TeleportTrustedBackForth(goForth: boolean)
```

- Tags: Roblox script security, Capabilities: Teleport

### TeleportTrustedBackHistory

```luau
TeleportService:TeleportTrustedBackHistory(placeId: number)
```

- Tags: Roblox script security, Capabilities: Teleport

### UnblockAsync

```luau
TeleportService:UnblockAsync(): ...any
```

- Tags: Yields, Roblox script security, Capabilities: Teleport

### ReserveServer

```luau
TeleportService:ReserveServer(placeId: number): ...any
```

- Tags: Deprecated, Yields, Capabilities: Teleport
- Use instead: [`TeleportService.ReserveServerAsync`](https://rapi.sleaze.dev/classes/TeleportService.md)

**Deprecated:** Use [`ReserveServerAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md) instead.

Returns an access code that can be used to teleport players to a reserved server, along with the [`DataModel.PrivateServerId`](https://rapi.sleaze.dev/classes/DataModel.md) for it.

Parameters:

- `placeId`: The [`DataModel.PlaceId`](https://rapi.sleaze.dev/classes/DataModel.md) of the place the reserved server is being created for.

Returns: The server access code required by [`TeleportService:TeleportToPrivateServer()`](https://rapi.sleaze.dev/classes/TeleportService.md) and the [`DataModel.PrivateServerId`](https://rapi.sleaze.dev/classes/DataModel.md) for the reserved server.

### TeleportPartyAsync

```luau
TeleportService:TeleportPartyAsync(placeId: number, players: { Instance }, teleportData: any, customLoadingScreen: Instance? = nil): string
```

- Tags: Deprecated, Yields, Capabilities: Teleport + UI
- Use instead: [`TeleportService.TeleportAsync`](https://rapi.sleaze.dev/classes/TeleportService.md)

**Deprecated:** Use [`TeleportAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md) instead. For a migration guide, see [Teleport between places](https://create.roblox.com/docs/projects/teleport#migrate-to-secure-teleports).

Teleports a group of [`Players`](https://rapi.sleaze.dev/classes/Players.md) to the same server of the place with the given `PlaceId`, returning the `JobId` of the server instance they were teleported to.

Parameters:

- `placeId`: The ID of the place to teleport to.
- `players`: An array containing the [`Players`](https://rapi.sleaze.dev/classes/Players.md) to teleport.
- `teleportData`: Optional data to be passed to the destination place. Can be retrieved using [`TeleportService:GetLocalPlayerTeleportData()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `customLoadingScreen`: Optional custom loading screen to be placed in the [`CoreGui`](https://rapi.sleaze.dev/classes/CoreGui.md) at the destination place. Can be retrieved using [`TeleportService:GetArrivingTeleportGui()`](https://rapi.sleaze.dev/classes/TeleportService.md).

Returns: The [`DataModel.JobId`](https://rapi.sleaze.dev/classes/DataModel.md) of the server instance the [`Players`](https://rapi.sleaze.dev/classes/Players.md) were teleported to.

### TeleportToPlaceInstance

```luau
TeleportService:TeleportToPlaceInstance(placeId: number, instanceId: string, player: Instance? = nil, spawnName: string? = "", teleportData: any, customLoadingScreen: Instance? = nil)
```

- Tags: Deprecated, Capabilities: Teleport + UI
- Use instead: [`TeleportService.TeleportAsync`](https://rapi.sleaze.dev/classes/TeleportService.md)

**Deprecated:** Use [`TeleportAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md) instead. For a migration guide, see [Teleport between places](https://create.roblox.com/docs/projects/teleport#migrate-to-secure-teleports).

Teleports a [`Player`](https://rapi.sleaze.dev/classes/Player.md) to the server instance associated with the given *placeId* and *instanceId*.

Parameters:

- `placeId`: The ID of the place to teleport to.
- `instanceId`: The [`DataModel.JobId`](https://rapi.sleaze.dev/classes/DataModel.md) of the server instance to teleport to.
- `player`: The [`Player`](https://rapi.sleaze.dev/classes/Player.md) to teleport, if this function is being called from the client this defaults to the [`Players.LocalPlayer`](https://rapi.sleaze.dev/classes/Players.md).
- `spawnName`: Optional name of the [`SpawnLocation`](https://rapi.sleaze.dev/classes/SpawnLocation.md) to spawn at.
- `teleportData`: Optional data to be passed to the destination place. Can be retrieved using [`TeleportService:GetLocalPlayerTeleportData()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `customLoadingScreen`: Optional custom loading screen to be placed in the [`CoreGui`](https://rapi.sleaze.dev/classes/CoreGui.md) at the destination place. Can be retrieved using [`TeleportService:GetArrivingTeleportGui()`](https://rapi.sleaze.dev/classes/TeleportService.md).

### TeleportToPrivateServer

```luau
TeleportService:TeleportToPrivateServer(placeId: number, reservedServerAccessCode: string, players: { Instance }, spawnName: string? = "", teleportData: any, customLoadingScreen: Instance? = nil)
```

- Tags: Deprecated, Capabilities: Teleport + UI
- Use instead: [`TeleportService.TeleportAsync`](https://rapi.sleaze.dev/classes/TeleportService.md)

**Deprecated:** Use [`TeleportAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md) instead. For a migration guide, see [Teleport between places](https://create.roblox.com/docs/projects/teleport#migrate-to-secure-teleports).

Teleport a group of [`Players`](https://rapi.sleaze.dev/classes/Players.md) to a reserved server created using [`TeleportService:ReserveServerAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md).

Parameters:

- `placeId`: The ID of the place to teleport to.
- `reservedServerAccessCode`: The reserved server access code returned by [`TeleportService:ReserveServerAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `players`: An array of [`Players`](https://rapi.sleaze.dev/classes/Players.md) to teleport.
- `spawnName`: Optional name of the [`SpawnLocation`](https://rapi.sleaze.dev/classes/SpawnLocation.md) to spawn at.
- `teleportData`: Optional data to be passed to the destination place. Can be retrieved using [`TeleportService:GetLocalPlayerTeleportData()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `customLoadingScreen`: Optional custom loading screen to be placed in the [`CoreGui`](https://rapi.sleaze.dev/classes/CoreGui.md) at the destination place. Can be retrieved using [`TeleportService:GetArrivingTeleportGui()`](https://rapi.sleaze.dev/classes/TeleportService.md).

### TeleportToSpawnByName

```luau
TeleportService:TeleportToSpawnByName(placeId: number, spawnName: string, player: Instance? = nil, teleportData: any, customLoadingScreen: Instance? = nil)
```

- Tags: Deprecated, Capabilities: Teleport + UI
- Use instead: [`TeleportService.TeleportAsync`](https://rapi.sleaze.dev/classes/TeleportService.md)

**Deprecated:** Use [`TeleportAsync()`](https://rapi.sleaze.dev/classes/TeleportService.md) instead. For a migration guide, see [Teleport between places](https://create.roblox.com/docs/projects/teleport#migrate-to-secure-teleports).

A variant of [`TeleportService:Teleport()`](https://rapi.sleaze.dev/classes/TeleportService.md) that causes the [`Player`](https://rapi.sleaze.dev/classes/Player.md) to spawn at a [`SpawnLocation`](https://rapi.sleaze.dev/classes/SpawnLocation.md) of the given name at the destination place.

Parameters:

- `placeId`: The ID of the place to teleport to.
- `spawnName`: The name of the [`SpawnLocation`](https://rapi.sleaze.dev/classes/SpawnLocation.md) to spawn at.
- `player`: The [`Player`](https://rapi.sleaze.dev/classes/Player.md) to teleport, if this function is being called from the client this defaults to the [`Players.LocalPlayer`](https://rapi.sleaze.dev/classes/Players.md).
- `teleportData`: Optional data to be passed to the destination place. Can be retrieved using [`TeleportService:GetLocalPlayerTeleportData()`](https://rapi.sleaze.dev/classes/TeleportService.md).
- `customLoadingScreen`: Optional custom loading screen to be placed in the [`CoreGui`](https://rapi.sleaze.dev/classes/CoreGui.md) at the destination place. Can be retrieved using [`TeleportService:GetArrivingTeleportGui()`](https://rapi.sleaze.dev/classes/TeleportService.md).

## Events

### LocalPlayerArrivedFromTeleport

```luau
TeleportService.LocalPlayerArrivedFromTeleport: RBXScriptSignal<(loadingGui: Instance, dataTable: any)>
```

- Tags: Capabilities: Teleport

Fires when the `LocalPlayer` enters the place following a teleport.

### MenuTeleportAttempt

```luau
TeleportService.MenuTeleportAttempt: RBXScriptSignal<()>
```

- Tags: Roblox script security, Capabilities: Teleport

### OpenExperienceDetailsPrompt

```luau
TeleportService.OpenExperienceDetailsPrompt: RBXScriptSignal<(universeId: number)>
```

- Tags: Roblox script security, Capabilities: Teleport

### ReconnectTeleportInitFailed

```luau
TeleportService.ReconnectTeleportInitFailed: RBXScriptSignal<(player: Instance, teleportResult: Enum.TeleportResult, errorMessage: string, placeId: number, teleportOptions: Instance)>
```

- Tags: Roblox engine security, Capabilities: Teleport

### SendVIPData

```luau
TeleportService.SendVIPData: RBXScriptSignal<(player: Instance, vipServerCode: string, dmPlaceID: number)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Teleport

### TeleportInitFailed

```luau
TeleportService.TeleportInitFailed: RBXScriptSignal<(player: Instance, teleportResult: Enum.TeleportResult, errorMessage: string, placeId: number, teleportOptions: Instance)>
```

- Tags: Capabilities: Teleport

Fires when a teleport fails to start, leaving the player in their current server.

### TeleportInitFailedInternal

```luau
TeleportService.TeleportInitFailedInternal: RBXScriptSignal<(player: Instance, teleportResult: Enum.TeleportResult, errorMessage: string, guid: string)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Teleport

### TeleportInProgress

```luau
TeleportService.TeleportInProgress: RBXScriptSignal<(player: Instance, teleportInfo: { [string]: any })>
```

- Tags: Hidden, Roblox engine security, Capabilities: Teleport

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
