How to make a player spawn on a specific part depending on data sent to it (Teleport service)

Is there a way to make a player spawn on a specific spot depending on the data that was sent (Teleport Service) For example, there are places A and B. If you enter A, you spawn at Point 1. However if you teleport to B and go back to A and the data “spawnAtPoint2” is sent with TeleportService, is there a way to use the data and make the player spawn on a specific place depending on the data. Thank you very much and have a nice day.

1 Like

In game 1, use Teleport with the data you want to give.
In game 2, use LocalPlayerArrivedFromTeleport or GetLocalPlayerTeleportData.
If you want to spawn the Player to a SpawnLocation directly, you can use TeleportToSpawnByName.

1 Like