Seeing as how my last friend wasn't getting anwsers here is my repost. Why does this only work once and evry tims you go back into the room the script automatically thinks there all dead
local trapdoors = game.Workspace.Trapdoors
while wait(1) do
local deadZombies = {}
for i, v in pairs(script.Parent:GetChildren())do
if v:FindFirstChild'Zombie' and v.Zombie.Health == 0 then
table.insert(deadZombies,v)
end
end
if #deadZombies == #script.Parent:GetChildren() - 1 then
_G.playerinbattle = {}
trapdoors.lockteleportdestination.Exit.exitscript.Disabled = false
trapdoors.lockteleportdestination.Exit.Material = "Neon"
trapdoors.lockteleportdestination.Exit.BrickColor = BrickColor.new("Dark stone grey")
trapdoors.lockteleportdestination.Exit.ParticleEmitter.Enabled = true
trapdoors.Lockteleport.TrapLight.SpotLight.Enabled = false
print('All Dead')
end
end
|