CharacterScript:
local Ve3 = Vector3.new
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local onLeftClick = mouse.Button1Down
onLeftClick:Connect(function()
plr.Character:MoveTo(Ve3(mouse.Hit.X, mouse.Hit.Y, mouse.Hit.Z))
end)
The Only Other Active Script (LocalScript):
local twait = task.wait
local Ve3 = Vector3.new
local plr = game.Players.LocalPlayer
-- Disable Regular Movement
local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()
Controls:Disable()
local ClickToMovePart = script.ClickToMovePart
ClickToMovePart.Parent = workspace
local mouse = plr:GetMouse() --- Gets Players Mouse
local mX,mY,mZ
while true do
mX,mY,mZ = mouse.Hit.X,mouse.Hit.Y,mouse.Hit.Z
ClickToMovePart.Position = Ve3(mX,mY,mZ)
twait()
end