This function returns a dictionary containing information on how the
Player joined the game.
The dictionary contains the fields below. Please note, whether these fields exists depends on the circumstances under which the
Player joined the game.
|Members||array|| An array containing the
|TeleportData||variant||Reflects the teleportData parameter specified in the original teleport function. This is useful in order to share information when teleporting a player from one place to another. It is only present if teleportData was specified and the teleport function was called from the server.|
GetJoinData and TeleportData
If the teleport the
Player arrived in the current place due to was initiated on a server (as opposed to a client) the
Player|Player’s teleportData is included in the dictionary returned by this function.
This function can only be used to fetch teleportData on the server, to retrieve it on the client use
In contrast to
TeleportService/GetLocalPlayerTeleportData, this function provides a number of security checks to the teleportData:
- It is guaranteed to have been sent by a Roblox server in the last 48 hours
- It is guaranteed to have been sent with this
- The SourcePlaceId returned is guaranteed to be the place the data was sent from. This means you can verify the TeleportData came from an approved place
However, as this data is transmitted by the client, it not 100% secure. Although the user cannot modify this data it is possible for them to view it or insert data from a previous teleport.
Despite this, it is still appropriate for the secure transmission of immutable data (data that can not be changed). For example, if the user has completed a level that cannot be uncompleted. Such data can be securely transmitted using this function avoiding the need to use up and wait for
GlobalDataStore|DataStore requests when teleporting.
You should not use this function for data that can be changed. For example, the amount of in-game currency the user currently has. This is because GetJoinData cannot guarantee a malicious user is not transmitting data from a previous session. For data like this, you should rely on
As with all cases, you should implement proper server validation to ensure your game is secure. For more information see this article on
A dictionary containing PlaceId and UserId values (see table in description).
Server TeleportData Example
The following code sample is an example of how teleport data can be retrieved on the server using
Player/GetJoinData. This code, when ran in a
ServerScriptService, will listen for new
Player|Players joining the game. When they join it will retrieve their teleport data (verifying it came from a valid place) to find their current level.