I want to make the Zombie script ignore 2 models instead of one by its name, but after doing that, one zombie doesn’t chase anything. And the other one chases themselves or the other zombie type.
Here is the part of the script, i’m using the drooling zombie ai script
local function handleHit(other)
if canHit then
if other and other.Parent and other.Parent.Name ~= "BnW" and "Cone" and other.Parent:FindFirstChild("Humanoid") then
local enemy = other.Parent
if enemy.Humanoid.WalkSpeed > 0 then
enemy.Humanoid.Health = enemy.Humanoid.Health - configs["Damage"]
canHit = false
end
end
else
Hey, you forget to add another Parent.Name check on the 2nd string check.
local function handleHit(other)
if canHit then
if other and other.Parent and other.Parent.Name ~= "BnW" and other.Parent.Name ~= "Cone" and other.Parent:FindFirstChild("Humanoid") then
local enemy = other.Parent
if enemy.Humanoid.WalkSpeed > 0 then
enemy.Humanoid.Health = enemy.Humanoid.Health - configs["Damage"]
canHit = false
end
end
else
local ignore_list = {"BnW", "Cone"}
local function handleHit(other)
if canHit then
if other and other.Parent and other.Parent:FindFirstChild("Humanoid") and not ignore_list[other.Parent.Name] then
local enemy = other.Parent
if enemy.Humanoid.WalkSpeed > 0 then
enemy.Humanoid.Health = enemy.Humanoid.Health - configs["Damage"]
canHit = false
end
end
else