So I’m making a pathfinding script that starts running when a remote event is fired. This is the script:
local RepStorage = game:GetService("ReplicatedStorage")
local ChasePlayerStealingCoffee = RepStorage:WaitForChild("ChasePlayerStealingCoffee")
local pathfindingservice = game:GetService("PathfindingService")
local humanoid = script.Parent.Humanoid
local torso = script.Parent.Torso
local path = pathfindingservice:CreatePath()
local PartToGoTo = game
ChasePlayerStealingCoffee.OnServerEvent:Connect(function(player,part)
print("So it reached here-")
PartToGoTo = player.Character.HumanoidRootPart.Position
local waypoints = path:GetWaypoints()
for i, waypoint in pairs(waypoints) do
humanoid:MoveTo(waypoint.Position)
humanoid.MoveToFinished:Wait()
end
end)
It does print “so it reached here-”, however the noob model it is in does not move, at all.