track how many people are left in survival

Is it possible to make it so that when one player remains in Survival mode and the other players are in spectator mode, an event occurs?
Continue to help post