local Input = game:GetService("UserInputService")
local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()

function To(position)
   local Chr = Plr.Character
   if Chr ~= nil then
       Chr.HumanoidRootPart.CFrame = position
   end
end

Input.InputBegan:Connect(function(input)
   if input.UserInputType == Enum.UserInputType.MouseButton1 then
       To(Mouse.Hit.p)
   end
end)