Best way to send info to reserved server?

I want to teleport a player to a reserved server with info.
Is there any better way to do it than to bind the info with the player(s) before teleporting?

What exactly is this method referring to?

This may be useful for you. TeleportService | Documentation - Roblox Creator Hub

Isn’t teleportData insecure?
Isn’t it sent through the client?

double checked and confirmed
teleportData is insecure because it’s sent through the client

The documentation does state teleportData is insecure (it derives from the client), and advises to use SetTeleportSetting for important information.

1 Like

It looks like SetTeleportSetting isn’t secure either
https://developer.roblox.com/en-us/api-reference/function/TeleportService/SetTeleportSetting

What kind of information are you trying to send through TeleportService? Theoretically you could validate the information on the new server and disconnect the player if the data isn’t what you expected.

1 Like

a Vector2
I didn’t know the :ReserveServer() function returned a PrivateServerId before this
I think I’ll just use the PrivateServerId as a key to store/get info from datastore

1 Like

This is super old. If you aren’t sending game-critical data (e.g. player levels, experience, cash, other sorts of player data), then this method is superseded by the server-side method of interacting with TeleportData and all of these methods will be doubly superseded when ephemeral DataStores are released to production. If you’re working with game-critical data, then you should stick to DataStores and migrate to ephemerals when they’re shipped.

You can declare TeleportData in a teleport initiated by the server and safely fetch it in the receiving instance when they arrive. Although data is sent with the client, it is only used as a method of transfer. The engine does data validation for you and will catch tampering early on, rejecting tampered data from showing. As far as I’m aware, TeleportData declared in a client-initiated teleport will not be able to be received by the server. An exploiter can reuse previously verified TeleportData however.

SetTeleportSetting is a more niche feature that you can use if you want to avoid using DataStores but need something to persist through teleports. You’ll almost never need to use it. TeleportData allows you to set variable amounts of data but even if a server-side method exists to get data, you shouldn’t transfer game-critical data either way. Ephemeral DataStores will solve all of these use cases in a flash; you may still need teleport settings or data every now and again, but won’t need to rely on it as much.

Check out this thread for information and gotchas about using teleport data with the server:

Looking for extra security? The following method will help you set an expiry time to data, so a client reusing teleport data that may inflict damage on your game’s systems can be doubly verified and you can prevent the one drawback of server-side teleport data access:

6 Likes