Help with Teleport Service

Hey There!
I will try to Explain What i Need Help with In the Shortest Way Possible In this Post.

Basically I Am Teleporting the Player From one Game place to Another.
But I Want the Teleportation to Happen with A Specific Message.

Suppose
I Teleport the Player with the Parameter “Hello”
and when the player joins in the other game i can print the parameter which is “Hello”.

local GamePlace = tpService:ReserveServer(GameId)
tpService:TeleportToPrivateServer(GameId, GamePlace, array, "Hello") -- My Message
game.Players.PlayerAdded:Connect(function(Player,Message)
  print(Message) -- It Prints nil
end)

Please Help!

For teleport data you will have to use the GetLocalPlayerTeleportData function:

game.Players.PlayerAdded:Connect(function(Player)
  local Message = game:GetService("TeleportService"):GetLocalPlayerTeleportData();
  print(Message)
end)
2 Likes

it still printed nil what do i do now
i used the same script with hello while teleporting
and i just replaced the game.Players.PlayerAdded with what you gave

Edit : Nvm found solution

If you’re using a server script, it wont be able to get teleport data from the player.
You’ll have to make it a LocalScript.
Or use a LocalScript with a RemoteEvent to send the data to the server script.

1 Like