Whenever i try to run my script it outputs this "13:52:44.021 - Workspace.NPC.Script:9: function arguments expected near 'for'" Here is my script:
local torso = script.Parent.Torso local base = workspace.Base.Position local humanoid = script.Parent.Humanoid local path = game:GetService("PathfindingService"):FindPathAsync(torso,base) local points = path:GetWaypoints for i,v in pairs(points) do local p = Instance.new("Part",workspace) p.Anchored = true p.CanCollide = false p.CFrame = CFrame.new(v.Position) p.Size = Vector3.new(1,1,1,) end if path.Status == Enum.PathStatus.Success then for i,v in pairs(points) do human:MoveTo(v.Position) human:.MoveToFinished:wait() if v.Action == Enum.PathWaypointAction.Jump then humanoid.Jump = true end end end
On line seven, you forgot to finish the :GetWaypoints() function/method. Just change
local points = path:GetWaypoints
to
local points = path:GetWaypoints()
EDIT: Also on line 20 you seem to have made a typo.
human:.MoveToFinished:wait()
should be
human.MoveToFinished:wait()