How to eliminate spawned guards at once

Spawn a guard with code like this.

spawner_device := class(creative_device):
    @editable
    Spawners : []spawner_selector = array{}

    OnBegin<override>()<suspends>:void=
        for(spawner : Spawners):
            spawner.Initialize()
        return

If one of these guards is eliminated, we want to eliminate all of them.

What code should I write where?

Sorry for the elementary question. Please answer.

In the spawner_selector class you could subscribe to the EliminatedEvent() on the guard spawner(s) and then despawn/disable the spawners when that happens.

Thank you for your wonderful answer!