local E local A=false for m,Y in pairs(zombie:GetChildren())do if Y:IsA("\080\097\114\116")and human.Health>0 then Y.Touched:connect(function(m)if m.Parent.Name==chaseName and(m.Parent.Name~=zombie.Name and not A)then A=true E=time()local Y=m.Parent local h=getHumanoid(Y)vars.Attacking.Value=true h:TakeDamage(ZombieDamage)vars.Attacking.Value=false while wait()do if E~=nil and time()>=E+DamageWait then A=false E=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:TakeDamage(ZombieDamage)
				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
