local zombieTypes = script.Parent.Parent.Parent
local zombies = {
zombieTypes.Boomer,
zombieTypes.Boomer2,
zombieTypes.Glaciator,
zombieTypes.Glaciator2,
zombieTypes.Healer,
zombieTypes.Viking
}
local deadZombies = {}
local door = script.Parent
for _, zombie in ipairs(zombies) do
local zombieHumanoid = zombie.Zombie
zombieHumanoid.Died:Connect(function()
deadZombies[zombie] = true
end)
end
function AllEnemiesCleared()
for _, zombie in ipairs(zombies) do
if not deadZombies[zombie] then
return false
end
end
return true
end
while not AllEnemiesCleared() do
wait(1)
end
print("gg")
script.Sound:Play()
door.Transparency = 1
door.CanCollide = false
|