Pick random player of Team1 after a player of Team2 is eliminated by creature...

Ok so, can you set your elimination device “Target Type” to Players Only and the Selected Team Index to 1 as you said the team 1 players will face zombies. Then try with this code :

EliminationManager1.EliminationEvent.Subscribe(OnPlayerElimination) # replace the old line
    OnPlayerElimination(Eliminator: ?agent) : void =
        TeamCollection := GetPlayspace().GetTeamCollection()

        if(
            not player[Eliminator?],
            Team2 := GetPlayspace().GetTeamCollection().GetTeams()[1],
            Team2Agents := TeamCollection.GetAgents[Team2],
            ShuffledAgents := Shuffle(Team2Agents)
        ):

            # Will store the first alive player into SelectedPlayerMaybe
            var SelectedPlayerMaybe : ?player = false
            for(Team2Agent : ShuffledAgents, not SelectedPlayerMaybe?, Player := player[Team2Agent], Player.GetFortCharacter[].IsActive[]):
                set SelectedPlayerMaybe = option{Player}

            if(SelectedPlayer := SelectedPlayerMaybe?):
                # Do your thing

I didn’t test it sorry, hope it works!

1 Like