I've been attempting to make a Teleport GUI that will teleport you to the hub, then teleport you to where you've stood before then. I've gotten to the point that you can teleport to the hub, and create a saved location, but I haven't been able to get it to teleport you back to that saved location.
What I've wanted to do is this:
-When you click the button, your position is saved by placing a brick in that spot. Then, the torso's position is sent to that of a brick in the hub's.
-When you click the button a second time, your position is sent to the saved brick. The saved brick is removed.
-The third time you click, you are sent back to the hub, and a new brick is created. The process repeats from there.
The problem is, I'm not sure of how to correctly implement this. I feel like I may have gotten slightly close before, but it hasn't been working out.
Here's the script so far:
local spawnpart = workspace.TeleportPart local playertorso = script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart local savepart = game.ReplicatedStorage.SavePart function Click() local savepartc = savepart:Clone() savepartc.Position = playertorso.Position playertorso.CFrame = CFrame.new(spawnpart.Position) end function Click() local savepartc = workspace:WaitForChild("SavePart") playertorso.CFrame = CFrame.new(savepartc.Position) savepartc.Position = playertorso.Position savepartc:Remove() end script.Parent.MouseButton1Down:connect(Click)
EDIT: This is only one place, and it's not a teleport between multiple games. Sorry for the lack of clarification!