local UIS = game:GetService("UserInputService") local LP = game.Players.LocalPlayer local Cam = workspace.CurrentCamera local char = LP.Character or LP.CharacterAdded:Wait() local hum = char:WaitForChild("Humanoid") local root = char:WaitForChild("HumanoidRootPart") local tool = Instance.new("Tool") tool.Name = "Teleport Tool" tool.RequiresHandle = false tool.Parent = LP:WaitForChild("Backpack") local function tp(pos) local ray = Cam:ViewportPointToRay(pos.X, pos.Y) local rp = RaycastParams.new() rp.FilterDescendantsInstances = {char, Cam} rp.FilterType = Enum.RaycastFilterType.Exclude local hit = workspace:Raycast(ray.Origin, ray.Direction * 5000, rp) local p = hit and hit.Position or ray.Origin + ray.Direction * 5000 local _, y = root.CFrame:ToOrientation() root.CFrame = CFrame.new(p) * CFrame.Angles(0, y, 0) end tool.Activated:Connect(function() if UIS.TouchEnabled then return end tp(UIS:GetMouseLocation()) end) UIS.TouchTap:Connect(function(t, g) if g or tool.Parent ~= char or #t == 0 then return end tp(Vector2.new(t[1].X, t[1].Y)) end) task.spawn(function() hum:EquipTool(tool) end)