If you use your game mode to spawn the players in, then create 4 arrays (Or however many teams you want max). One for each team. Add your players to whichever array they belong to (Team0 through Team3 for 4 teams). You should also tell each player which team they’re on using an int variable for later use.
When a player takes damage, do your normal health subtraction or whatever, including your death events, but before you destroy the actor (if you’re doing that) then call a function on your game mode checking for the remaining players of that team.
And the function on your game mode (can also be a custom event if you prefer) should be something like this:
I’m using a Select and plugging in all the possible teams. You can also keep track of how many teams are dead to finish the entire game with another int that counts up or down whenever a team is declared defeated.
Hopefully that helps. I also used a break on the for each loop so it doesn’t continue to check for more players on the team once it finds one alive. It only needs one alive to keep playing.