v.NPC.Humanoid:MoveTo(v.Start.Position) while not v.NPC.Humanoid.MoveToFinished:wait() do if spotted == true and (workspace:WaitForChild("Bylocks").HumanoidRootPart.Position - v.NPC.HumanoidRootPart.Position).magnitude <= 10 then workspace:WaitForChild("Bylocks"):WaitForChild("UpperTorso"):Destroy() end end
The intent of this is when it begins moving while it hasn’t finished moving that if you are within 10 maginitude or studs or whatever that it would kill me. However this isn’t the case, it doesn’t kill me. Though it still finishes because when I put a print after the while loop it prints.
Any fixes you have in mind?