local G local w=false for E,a in pairs(zombie:GetChildren())do if a:IsA("\080\097\114\116")and human.Health>0 then a.Touched:connect(function(E)if E.Parent.Name==chaseName and(E.Parent.Name~=zombie.Name and not w)then w=true G=time()local a=E.Parent local A=getHumanoid(a)vars.Attacking.Value=true A.WalkSpeed=0 local L=script.Parent.Zombie:LoadAnimation(script.Parent.Attack)L:Play()script.Parent.HumanoidRootPart.Theme:Stop()head.Jumpscare:Play()wait(.83)head.Hit2:Play()A:TakeDamage(ZombieDamage)wait(1)script.Parent.HumanoidRootPart.Theme:Play()vars.Attacking.Value=false while wait()do if G~=nil and time()>=G+DamageWait then w=false G=nil end end end end)end end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

local damagetime
local damagedb = false

for _, zambieparts in pairs(zombie:GetChildren()) do
	if zambieparts:IsA("Part") and human.Health > 0 then
		zambieparts.Touched:connect(function(p)
			if p.Parent.Name == chaseName and p.Parent.Name ~= zombie.Name and not damagedb then -- damage
				damagedb = true
				damagetime = time()
				local enemy = p.Parent
				local enemyhuman = getHumanoid(enemy)
				vars.Attacking.Value = true
				enemyhuman.WalkSpeed = 0
				local animation = script.Parent.Zombie:LoadAnimation(script.Parent.Attack)
				animation:Play()
				script.Parent.HumanoidRootPart.Theme:Stop()
				head.Jumpscare:Play()
				wait(0.83)
				head.Hit2:Play()
				enemyhuman:TakeDamage(ZombieDamage)
				wait(1)
				script.Parent.HumanoidRootPart.Theme:Play()
				vars.Attacking.Value = false
				while wait() do
					if damagetime ~= nil and time() >= (damagetime + DamageWait) then
						damagedb = false
						damagetime = nil
					end
				end
			end
		end)
	end
end
