How do you check what place id a player has previously teleported from

Hello, I have a city game that teleports other places when they enter a really large building (mainly to reduce lag). But when teleporting back to the main game the player spawns on the default spawn point. Is their any possible way to check if a player has teleported from a previous game? (and if they did, what game id was it). thanks in advance

You could pass through the PlaceId on the place they’re being teleport from using TeleportData and then pull the TeleportData from the arrival place


TeleportService:Teleport(IdOfPlaceYouTeleportTo, Player, game.PlaceId)

Then in the receiving game:

local PlaceId = TeleportService:GetLocalPlayerTeleportData()
print("This player came from:", PlaceId)
1 Like

Ah ok thanks, just curious, where does the script for the receiving game go?

In my game I put it inside of StarterPlayer → StarterPlayerScripts in a local script, and then I beam the information to the server with a RemoteEvent then I lock the RemoteEvent so an exploiter can’t spoof it

1 Like

Thanks, but I still have a slight problem, the local script in StarterPlayerScripts does not work printing the error “Argument 1 missing or nil”. I thought it was because I was running on roblox studio so it cant detect teleports but when I teleport to that game on roblox it still shows that error

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.