Passing and receiving "value" through TS:TeleportToPrivateServer

Hello, I have something that is probably simple.
I know I can pass multiple values with TS:TeleportToPrivateServer() but I don’t know how to recieve / access / use them.
How can I do this?
My goal is to teleport players and pass a value that starts the minigame based off the value passed, how can I access the value passed from the private/reserved server?

1 Like

You can use set the TeleportData then receive it in a LocalScript using GetLocalPlayerTeleportData(). Be carful though because exploiters can change/manipulate the value being passed so it’s better to use something like DataStores or maybe MessagingServicd would work (but I have no experience with that)

Teleport Data Links:
https://developer.roblox.com/en-us/api-reference/function/TeleportService/GetLocalPlayerTeleportData
https://developer.roblox.com/en-us/api-reference/function/TeleportOptions/SetTeleportData

Datastore links:
https://developer.roblox.com/en-us/api-reference/class/DataStoreService
https://developer.roblox.com/en-us/api-reference/class/GlobalDataStore

Messaging Service:
https://developer.roblox.com/en-us/api-reference/class/MessagingService