I'm so confused, how do i make a gui that teleports you to a part and teleports you back where you were standing before.
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.character.Torso.CFrame = CFrame.new(workspace.TPPart.position) wait (0.3) game.Players.LocalPlayer.character.Torsto.CFrame = CFrame.new(player.position) end)
Any help would be appreciated
Make sure to make this a LOCAL SCRIPT, not a script.
local player = game.Players.LocalPlayer local HRP = player.Character: WaitForChild("HumanoidRootPart") local button = script.Parent --change this the location of your button local part = game.Workspace:FindFirstChild("TeleportPart")--Change this to location of your part button.MouseButton1Click:Connect(function() --keep track of position before being teleported local originalPosition = HRP.CFrame --teleport the player by changing the position if it's humanoid root part to be the position of the part in game HRP.CFrame = Part.CFrame + Vector3.new(0,5,0) --wait 5 seconds wait(5) --teleport player back to original position HRP.CFrame = originalPosition end