How do I disable a spawner once the floor it is on gets destroyed?

I’m currently making a game where a team is eliminated once their tower is destroyed. Once they are eliminated, they will be switching teams. I want to eliminate a team once all of their spawners are destroyed. How can I disable or destroy a spawner once the floor it is on is destroyed? Alternatively, is there a way or a device that can detect a wall or a certain amount of building being destroyed to eliminate the team?