How To Teleport A Person To a Specific Spawn After Leaving Another Experience

Hello! I’m looking to create a game where multiple places are inside one experience. I’m having trouble figuring out the following:

Let’s say there is one experience and two places inside of it. A player spawns in place “A” they have to walk to a specific door to reach the teleport for place “B”. How do I make it so when they teleport from place “B” back to place “A” they don’t spawn at the origin spawn point but rather at the door that teleport them from place “A” to place “B”. For example: In meep city, if you walk into the tunnel it takes you to the next place, but when you teleport back you don’t spawn at the main spawning area you spawn back at the tunnel in place A.

You can use teleport data to send information with the player that could tell the new place where to spawn the character.

I’m confused by this so like, what would myself resemble or what would I need to change in this script?

local TeleportService = game:GetService("TeleportService")

local Place = 10136136177

script.Parent.Touched:Connect(function(hit)

local player = game.Players:GetPlayerFromCharacter(hit.Parent)

if player then

TeleportService:Teleport(Place, player)

end

end)

https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportToSpawnByName

1 Like

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