local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local mouse = player:GetMouse() local PlayerGui = player:WaitForChild("PlayerGui") -- Position memory local clickedPosition = nil local originalPosition = nil local customReturnPosition = nil local isTeleporting = false -- GUI local screenGui = Instance.new("ScreenGui", PlayerGui) screenGui.Name = "ClickTeleportGui" local posLabel = Instance.new("TextLabel", screenGui) posLabel.Size = UDim2.new(0, 300, 0, 50) posLabel.Position = UDim2.new(0.5, -150, 0.1, 0) posLabel.BackgroundColor3 = Color3.new(0, 0, 0) posLabel.BackgroundTransparency = 0.5 posLabel.TextColor3 = Color3.new(1, 1, 1) posLabel.TextScaled = true posLabel.Font = Enum.Font.SourceSansBold posLabel.Text = "Click anywhere to get position" local tpButton = Instance.new("TextButton", screenGui) tpButton.Size = UDim2.new(0, 150, 0, 50) tpButton.Position = UDim2.new(0.5, -75, 0.2, 0) tpButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255) tpButton.TextColor3 = Color3.new(1, 1, 1) tpButton.TextScaled = true tpButton.Font = Enum.Font.SourceSansBold tpButton.Text = "TP to Here" tpButton.AutoButtonColor = true tpButton.Active = false tpButton.BackgroundTransparency = 0.7 local returnLabel = Instance.new("TextLabel", screenGui) returnLabel.Size = UDim2.new(0, 200, 0, 30) returnLabel.Position = UDim2.new(0.5, -100, 0.35, 0) returnLabel.BackgroundColor3 = Color3.new(0, 0, 0) returnLabel.BackgroundTransparency = 0.5 returnLabel.TextColor3 = Color3.new(1, 1, 1) returnLabel.TextScaled = true returnLabel.Font = Enum.Font.SourceSans returnLabel.Text = "Press E to set custom return point" -- Reset Humanoid for movement local function resetHumanoid(character) if not character then return end local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid then for _, joint in pairs(character:GetDescendants()) do if joint:IsA("Motor6D") then joint.Enabled = true end end humanoid.PlatformStand = false humanoid.Sit = false humanoid:ChangeState(Enum.HumanoidStateType.GettingUp) humanoid:ChangeState(Enum.HumanoidStateType.Running) end end -- Teleport Helper local function teleportTo(pos) local char = player.Character if not char then return end local hrp = char:FindFirstChild("HumanoidRootPart") if hrp then hrp.CFrame = CFrame.new(pos + Vector3.new(0, 5, 0)) local humanoid = char:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.Health = humanoid.MaxHealth humanoid.PlatformStand = false humanoid:ChangeState(Enum.HumanoidStateType.Physics) end resetHumanoid(char) end end -- Mouse click: Get world position mouse.Button1Down:Connect(function() local target = mouse.Target if not target then return end clickedPosition = mouse.Hit.Position posLabel.Text = string.format("Clicked Pos: (%.1f, %.1f, %.1f)", clickedPosition.X, clickedPosition.Y, clickedPosition.Z) tpButton.Active = true tpButton.BackgroundTransparency = 0 end) -- Press E to mark custom return point UserInputService.InputBegan:Connect(function(input, gpe) if gpe then return end if input.KeyCode == Enum.KeyCode.E then local char = player.Character if not char then return end local hrp = char:FindFirstChild("HumanoidRootPart") if not hrp then return end customReturnPosition = hrp.Position returnLabel.Text = "Custom Return Set!" end end) -- TP Button clicked tpButton.MouseButton1Click:Connect(function() if not clickedPosition or isTeleporting then return end local char = player.Character if not char then return end local hrp = char:FindFirstChild("HumanoidRootPart") if not hrp then return end -- Save original position before teleporting originalPosition = hrp.Position isTeleporting = true -- Teleport to clicked point teleportTo(clickedPosition) -- Disable button tpButton.Active = false tpButton.BackgroundTransparency = 0.7 -- Countdown label local countdownLabel = Instance.new("TextLabel", screenGui) countdownLabel.Size = UDim2.new(0, 150, 0, 50) countdownLabel.Position = UDim2.new(0.5, -75, 0.3, 0) countdownLabel.BackgroundColor3 = Color3.new(0, 0, 0) countdownLabel.BackgroundTransparency = 0.5 countdownLabel.TextColor3 = Color3.new(1, 1, 1) countdownLabel.TextScaled = true countdownLabel.Font = Enum.Font.SourceSansBold countdownLabel.Parent = screenGui local countdown = 10 local teleportedStart = clickedPosition local stopForceBypass = false -- Start force TP override loop task.spawn(function() while not stopForceBypass do local current = player.Character and player.Character:FindFirstChild("HumanoidRootPart") if current and (current.Position - teleportedStart).Magnitude > 10 then -- Forcefully moved — teleport back teleportTo(teleportedStart) end task.wait(0.2) end end) -- Countdown loop while countdown > 0 do countdownLabel.Text = "Returning in: " .. countdown wait(1) countdown -= 1 end stopForceBypass = true -- Return to the correct place local returnTo = customReturnPosition or originalPosition teleportTo(returnTo) countdownLabel:Destroy() isTeleporting = false end)