I would like to use “:MoveTo”, my only problem is that the player is still able to move, while the character is moving, which is causing my script to not work properly.
Basically, I want it to the character can still move, so it can walk to the points, but the player cannot use WASD to walk during this.
My Code:
Might not work, but I hope it does!
Constantly Moves Player.
local Var = false
local function MovePlayer(plr)
while Var == true do
if game.Workspace:FindFirstChild(plr.Name).Humanoid ~= nil then
game.Workspace:FindFirstChild(plr.Name).Humanoid:MoveTo("PutPartNameHere")
wait(0.01)
end
end
game.Workspace:FindFirstChild("PART").Touched:Connect(function(Part)
--Make Sure to check if player
Var = false
local function Start(plr)
Var = true
MovePlayer(plr)
end