How to send data during teleportation across Roblox Places (+ Custom TP GUI)

Ever wondered how to send data between places? For example in a game that uses a seperate place for the lobby and the map? I will be showing you a very simple way! As well as the method to set a custom teleport GUI to replace the default roblox “Placename” teleport.

Firstly, we import the TeleportService

local TeleportService = game:GetService("TeleportService")

Next we just define the teleport data that we need.

TeleportService:SetTeleportSetting("ValueName", Value)

And then in the arrival place, you just do this in a localscript:

local teleportData = TeleportService:GetLocalPlayerTeleportData()

This will print all the data in a table, otherwise to set a specific value you do the following

local Valuename =  TeleportService:GetTeleportSetting("ValueName")

As for setting a custom teleport UI, it’s as simple as this:

TeleportService:SetTeleportGui(heregoesyourGUI)

Make sure your heregoesyourGUI variable is a path to the teleportGUI you need.

Difference between teleport settings and datastores: (From Roblox Documentation)

  • GlobalDataStore:SetAsync() stores the data on Roblox servers whereas SetTeleportSetting stores the data locally

  • Data stored in a GlobalDataStore is preserved after the user leaves the game universe whereas teleport settings are not

  • GlobalDataStores can only be accessed on the server, whereas teleport settings can only be accessed on the client

  • GlobalDataStores have usage limits, whereas teleport settings do not

In general teleport settings should be used to preserve client side information within a single play session across different places in a game. GlobalDataStores should be used to save important player data that needs to be accessed across player sessions.](TeleportService | Documentation - Roblox Creator Hub)

This is my first informational post on the dev forum, hope it helps someone!

8 Likes

#resources:community-tutorials
There you go :slight_smile:

1 Like

Ah damn i didn’t realize it doesnt post in the thread you have selected smh

2 Likes

Should’ve warned that teleport date is spoofable by exploiters.

3 Likes

Indeed, considering its client side. It all depends on the sensitivity of data you are planning to send, i for example use it for a slot system that sets the TP data to “Slot1” or “slot2”, etc depending on the slot selected, the other place then uses that data to fetch the more sensitive data from the datastore with the appropriate slot! Not much point in exploiting this

2 Likes