ok so im trying to make an npc in a shooting range go to an ammo box and refill, then go back to their orginal position, except it won’t no matter what i do 
script.Parent:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(script.Parent:WaitForChild("Animations"):WaitForChild("Idle")):Play()
wait(1.4)
local gun = script.Parent:WaitForChild("aiAK47")
local pfs = game:GetService("PathfindingService")
local spot = Instance.new("Part", workspace)
spot.Name = "Spot"
spot.Transparency = 1
spot.Anchored = true
spot.Position = script.Parent:WaitForChild("UpperTorso").Position
spot.CanCollide = false
while true do
for c = 1, 30 do
gun.Handle.Attachment.PointLight.Enabled = true
gun.Handle.Attachment.ParticleEmitter:Emit(6)
gun.Handle.Gunfire:Play()
wait(0.02)
gun.Handle.Attachment.PointLight.Enabled = false
wait(0.3)
end
wait(1)
local path = pfs:CreatePath()
path:ComputeAsync(script.Parent.UpperTorso.Position, workspace.AmmoBoxPickupAI.Position)
local wp = path:GetWaypoints()
for i, wahfiu in pairs(wp) do
script.Parent.Humanoid:MoveTo(wahfiu.Position)
script.Parent.Humanoid.MoveToFinished:Wait(2)
end
wait(1)
workspace.AmmoBox.Sound:Play()
wait(3)
path2 = pfs:CreatePath()
path2:ComputeAsync(script.Parent.UpperTorso.Position, spot.Position)
local wp2 = path2:GetWaypoints()
for i, wahfiua in pairs(wp2) do
script.Parent.Humanoid:MoveTo(wahfiua.Position)
script.Parent.Humanoid.MoveToFinished:Wait(2)
end
wait(2)
end
help is greatly appreciated
