PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

TeleportService

Show deprecated

TeleportService

Show deprecated

The TeleportService is responsible for transporting Player|Players between Articles/Place|places and servers.

‘Teleporting’ in Roblox, describes the transportation of Player|Players between different places and servers. TeleportService provides a range of functions allowing single or groups of users to be teleported. As Roblox Articles/Multi Place Games|games can contain multiple places, you can use the TeleportService to teleport players between different levels.

Which teleport function should I use?

A variety of teleportation functions are available and are all suitable for different circumstances:

See also

  • TeleportService/Teleport|Teleport for teleporting a single Player to a place
  • TeleportService/TeleportToSpawnByName|TeleportToSpawnByName for teleporting a single Player to a place, spawning at a particular SpawnLocation
  • TeleportService/TeleportToPlaceInstance|TeleportToPlaceInstance for teleporting a single Player to a specific server instance in a place that is part of the same game
  • TeleportService/TeleportPartyAsync for teleporting a group of Player|Players to one server in a place that is part of the same game
  • TeleportService/TeleportToPrivateServer for teleporting a group of Player|Players to a reserved server created using TeleportService/ReserveServer

Properties

Functions

Instance

GetArrivingTeleportGui ( )

Returns the customLoadingScreen the Players/LocalPlayer|LocalPlayer arrived into the place with

Variant

GetLocalPlayerTeleportData ( )

Returns the teleportData the Players/LocalPlayer arrived into the place with

Tuple

GetPlayerPlaceInstanceAsync ( int64 userId )

[Yields]

Returns the DataModel/PlaceId and DataMode/lJobId of the server the user with the given Player/UserId is in provided it is in the same game as the current place

Variant

GetTeleportSetting ( string setting )

Retrieves a teleport setting saved using TeleportService/SetTeleportSetting using the given key

Tuple

ReserveServer ( int64 placeId )

[Yields]

Returns an access code that can be used to teleport players to a reserved server, along with the DataModel/PrivateServerId for it

void

SetTeleportGui ( Instance gui )

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

void

SetTeleportSetting ( string setting , Variant value )

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

void

Teleport ( int64 placeId , Instance player , Variant teleportData , Instance customLoadingScreen )

Teleports a Player to the place associated with the given placeId

string

TeleportPartyAsync ( int64 placeId , Objects players , Variant teleportData , Instance customLoadingScreen )

[Yields]

Teleports a group of Player|Players to the same server of the place with the given DataModel/PlaceId|PlaceId, returning the DataModel/JobId|JobId of the server instance they were teleported to

void

TeleportToPlaceInstance ( int64 placeId , string instanceId , Instance player , string spawnName , Variant teleportData , Instance customLoadingScreen )

Teleports a Player to the server instance associated with the given placeId and instanceId

void

TeleportToPrivateServer ( int64 placeId , string reservedServerAccessCode , Objects players , string spawnName , Variant teleportData , Instance customLoadingScreen )

Teleport a group of Player|Players to a reserved server created using TeleportService/ReserveServer

void

TeleportToSpawnByName ( int64 placeId , string spawnName , Instance player , Variant teleportData , Instance customLoadingScreen )

A variant of TeleportService/Teleport that causes the Player to spawn at a SpawnLocation of the given name at the destination place

Events

RBXScriptSignal

LocalPlayerArrivedFromTeleport ( Instance loadingGui , Variant dataTable )

Fires when the Players/LocalPlayer|LocalPlayer enters the place following a teleport. Provides the Player|Player’s teleportData and customLoadingScreen

RBXScriptSignal

TeleportInitFailed ( Instance player , TeleportResult teleportResult , string errorMessage )

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