Nvm, I fixed it using the following code;
local NPC = script.Parent.Humanoid
local WayPoints = game.Workspace.Position:GetChildren()
local Action = game.Workspace.Position.Action.Value
local OwnsPoint = false
local PointToMoveTo
local NPCNumb
NPCNumb = game.Workspace.Position.LegionaryNumb.Value
game.Workspace.Position.LegionaryNumb.Value += 1
for i, Point in pairs(WayPoints) do
if not OwnsPoint then
if Point.Name ~= "Centurion" and Point.Name ~= "Standard" and Point.Name ~= "Flag" then
print(Point.Name)
if not Point:FindFirstChild("Owner") then
if Point:IsA("Part") or Point:IsA("BasePart") then
local OwnedPoint = Instance.new("StringValue")
OwnedPoint.Name = "Owner"
OwnedPoint.Value = NPCNumb
OwnedPoint.Parent = Point
OwnsPoint = true
PointToMoveTo = Point
else
print("Point is not a part or BasePart")
end
else
print("Point is owned!")
end
else
print(Point.Name)
end
else
print("Owns a point")
if Point.Name ~= "Centurion" and Point.Name ~= "Standard" and Point.Name ~= "Flag" then
print(Point.Name)
if Point:FindFirstChild("Owner") then
if Point:FindFirstChild("Owner").Value == NPCNumb then
if Point:IsA("Part") or Point:IsA("BasePart") then
OwnsPoint = true
PointToMoveTo = Point
else
print("Point is not a part or BasePart")
end
end
else
print("Point is owned!")
end
else
print(Point.Name)
end
end
end
local function March()
if Action ~= "Charge" then
NPC:MoveTo(PointToMoveTo.Position)
end
end
while wait() do
March()
end
A lot more complicated then I had it before lol. Anyways there was no need to be looping that long script over and over so many times.