Enemy (uses drooling zombie AI) won't move after playing attack animation

zombieHumanoid = script.Parent.Humanoid
script.Parent.Torso.Touched:Connect(function(otherPart: BasePart)
	if game.Players:GetPlayerFromCharacter(otherPart.Parent)~=nil then
		local speed = zombieHumanoid.WalkSpeed
		local anims = script.Parent.Animations.AttackAnims:GetChildren()
		if #anims == 0 then return end -- No animations to play
		local anim = anims[math.random(1,#anims)]

		local animator = zombieHumanoid:FindFirstChildOfClass("Animator")
		if not animator then return end -- No animator
		zombieHumanoid.WalkSpeed=0
		local track = zombieHumanoid:LoadAnimation(anim) -- Use zombieHumanoid and its Animator
		track:Play()
		zombieHumanoid.WalkSpeed=20
	end	
end)

Whenever a zombie attacks a player, it just stops, and won’t move at all after that. Note: The zombie uses the standard Drooling Zombie AI, although the damage code is modified to this:

local healths = {
	"LeftArm",
	"RightArm",
	"LeftLeg",
	"RightLeg",
	"Head",
	"Torso",
}
local zombie = script.Parent
damage = math.random(35,50)
function LoadSound(path,location)
	local sounds = script.Sounds:FindFirstChild(path)
	if sounds==nil then return nil end
	local soundslist = sounds:GetChildren()
	local sound = soundslist[math.random(1,#soundslist)]
	if not sound:IsA("Sound") then return nil end
	local audio = sound:Clone(location)
	audio.PlaybackSpeed=math.random(80,120)/100
	audio.Volume=math.random(40,75)/100
	audio.RollOffMinDistance=math.random(5,15)
	audio.RollOffMaxDistance=math.random(30,50)
	audio:Play()
	game.Debris:AddItem(audio,audio.TimeLength*audio.PlaybackSpeed)
end
db=false
script.Parent.Torso.Touched:Connect(function(otherPart: BasePart)
	local zombieHumanoid = script.Parent.Humanoid
	local zombieRootPart = script.Parent.HumanoidRootPart
	local char = otherPart.Parent
	local medical = char:FindFirstChild("Medical")
	if medical~=nil and db==false and char.Name~="Drooling Zombie" and zombieHumanoid and zombieHumanoid.Health > 0 then
		local health = healths[math.random(1,#healths)]
		local hp = medical:FindFirstChild(health.."Health")
		local head = char:FindFirstChild("Head")
		if hp~=nil then
			hp.Value=hp.Value-(damage*(math.random(75,150)/100))
		end

		local injury=medical:FindFirstChild(health.."Injury")
		if injury~=nil then
			if injury.Value=="None" then
				if math.random(1,8)==1 then
					if math.random(1,5)==1 then
						injury.Value="InfectedBite"
					else
						injury.Value="Bite"
					end
					if head~=nil then LoadSound("Bite",head) end
				elseif math.random(1,4)==1 then
					if math.random(1,3)==1 then
						injury.Value="MajorBruise"
					else
						injury.Value="MinorBruise"
					end
					if head~=nil then LoadSound("Bruise",head) end
				else
					if math.random(1,5)==1 then
						injury.Value="InfectedScratch"
					else
						injury.Value="Scratch"
					end
					if head~=nil then LoadSound("Scratch",head) end
				end
			end
		end
		db=true
		local hum = char:FindFirstChildOfClass("Humanoid")
		if hum~=nil then
			if math.random(1,math.round(hum.Health/8))==1 then
				hum.Sit=true
			end
		end
		task.wait(0.5)
		db=false
	else

	end
end)

Note that the damage code and animation code are in separate scripts. The Arms animation in the default drooling zombie model is disabled as well.

Is it guaranteed that this is caused by it playing the animation and not by it reaching the player?
If not, it could be that once it reaches the player it stops trying to move towards them, thinking it’s still at them even if they move.

that could be a reason (not animation). By the way, may I have full script of ur zombie or maybe send piece script where zombie walks to a player?

It’s the default drooling zombie AI. Drop the classic drooling zombie model into a baseplate, and the sweet juicy code is inside the ModuleScripts. Keep in mind I removed the animation code from the modulescripts, and also the custom scripts are in the original post.

I’ve been mistaken and now corrected. When the animation code is disabled, the zombie still stops after attacking.