API:Class/TeleportService

Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.

ExplorerImageIndex70.pngTeleportService : Object Icon.pngInstance

This service makes it possible to teleport players from one place to another. Since a game can contain multiple places, this allows a game to contain different levels and players can be transported from one place to another.

Properties

PropertiesmemberhiddenProperties [toggle]

boolCustomizedTeleportUI [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/TeleportService/CustomizedTeleportUI"|Deprecated. Do not use.|/RMD|
Deprecated. Do not use.

Functions

Functions [toggle]

VariantGetLocalPlayerTeleportData ( )

Returns what was set as the LocalPlayer's teleportData parameter, when either Teleport, TeleportToPlaceInstance, TeleportToPrivateServer, or TeleportToBySpawnName was called from a previous game.

|RMD member="API:Class/TeleportService/GetLocalPlayerTeleportData"|Returns what was set as the LocalPlayer's teleportData parameter, when either Teleport, TeleportToPlaceInstance, TeleportToPrivateServer, or TeleportToBySpawnName was called from a previous game.|/RMD|
VariantGetTeleportSetting ( string setting )

Retrieves a previously stored value with the given key, or nil if the given key doesn't exist. Note: This method is intended for storing information on the client that can persist between game instances when teleporting, it should not be used on the server.

|RMD member="API:Class/TeleportService/GetTeleportSetting"|Retrieves a previously stored value with the given key, or nil if the given key doesn't exist. Note: This method is intended for storing information on the client that can persist between game instances when teleporting, it should not be used on the server.|/RMD|
voidSetTeleportSetting ( string setting, Variant value )

Stores a given value for later use under the given key. The value will persist across place teleportations as long as they are in the same game. Note: this method is intended for use on the client only and should not be used on the server.

|RMD member="API:Class/TeleportService/SetTeleportSetting"|Stores a given value for later use under the given key. The value will persist across place teleportations as long as they are in the same game. Note: this method is intended for use on the client only and should not be used on the server.|/RMD|
voidTeleport ( int placeId, Player player = nil, Variant teleportData, ScreenGui customLoadingScreen = nil )

Used to teleport a player to the place with ID placeId.

|RMD member="API:Class/TeleportService/Teleport"|Used to teleport a player to the place with ID placeId.|/RMD|
voidTeleportToPlaceInstance ( int placeId, string instanceId, Player player = nil, string spawnName = "", Variant teleportData, ScreenGui customLoadingScreen = nil )

Will teleport the given player to a specific place instance given a placeId and an instanceId.

|RMD member="API:Class/TeleportService/TeleportToPlaceInstance"|Will teleport the given player to a specific place instance given a placeId and an instanceId.|/RMD|
voidTeleportToPrivateServer ( int placeId, string reservedServerAccessCode, array<Player> players, string spawnName = "", Variant teleportData, ScreenGui customLoadingScreen = nil )

Used to teleport one or more players to a reserved server.

|RMD member="API:Class/TeleportService/TeleportToPrivateServer"|Used to teleport one or more players to a reserved server.|/RMD|
voidTeleportToSpawnByName ( int placeId, string spawnName, Player player = nil, Variant teleportData, ScreenGui customLoadingScreen = nil )

Teleports player to a specific SpawnLocation.

|RMD member="API:Class/TeleportService/TeleportToSpawnByName"|Teleports player to a specific SpawnLocation.|/RMD|
Returns what was set as the LocalPlayer's teleportData parameter, when either Teleport, TeleportToPlaceInstance, TeleportToPrivateServer, or TeleportToBySpawnName was called from a previous game.
Retrieves a previously stored value with the given key, or nil if the given key doesn't exist. Note: This method is intended for storing information on the client that can persist between game instances when teleporting, it should not be used on the server.
SetTeleportSetting ( string setting, Variant value )
Stores a given value for later use under the given key. The value will persist across place teleportations as long as they are in the same game. Note: this method is intended for use on the client only and should not be used on the server.
Teleport ( int placeId, Player player = nil, Variant teleportData, ScreenGui customLoadingScreen = nil )
Used to teleport a player to the place with ID placeId.
TeleportToPlaceInstance ( int placeId, string instanceId, Player player = nil, string spawnName = "", Variant teleportData, ScreenGui customLoadingScreen = nil )
Will teleport the given player to a specific place instance given a placeId and an instanceId.
TeleportToPrivateServer ( int placeId, string reservedServerAccessCode, array<Player> players, string spawnName = "", Variant teleportData, ScreenGui customLoadingScreen = nil )
Used to teleport one or more players to a reserved server.
TeleportToSpawnByName ( int placeId, string spawnName, Player player = nil, Variant teleportData, ScreenGui customLoadingScreen = nil )
Teleports player to a specific SpawnLocation.

YieldFunctions

YieldFunctions [toggle]

bool, string, int, stringGetPlayerPlaceInstanceAsync ( int userId )

Returns information about which place a player is currently in, if it's in the same universe.

|RMD member="API:Class/TeleportService/GetPlayerPlaceInstanceAsync"|Returns information about which place a player is currently in, if it's in the same universe.|/RMD|
stringReserveServer ( int placeId )

Returns a server access code that can be used with TeleportToPrivateServer.

|RMD member="API:Class/TeleportService/ReserveServer"|Returns a server access code that can be used with TeleportToPrivateServer.|/RMD|
Returns information about which place a player is currently in, if it's in the same universe.
ReserveServer ( int placeId )
Returns a server access code that can be used with TeleportToPrivateServer.

Events

Events [toggle]

LocalPlayerArrivedFromTeleport ( ScreenGui loadingGui, Variant dataTable )

The teleportData and customLoadingScreen from the Teleport methods.

|RMD member="API:Class/TeleportService/LocalPlayerArrivedFromTeleport"|The teleportData and customLoadingScreen from the Teleport methods.|/RMD|
The teleportData and customLoadingScreen from the Teleport methods.

|RMD member="API:Class/TeleportService"|This service makes it possible to teleport players from one place to another. Since a game can contain multiple places, this allows a game to contain different levels and players can be transported from one place to another. |/RMD|



Tutorials Used In

TeleportService Guide