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.
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)