# How to compare multiple players that are using the same type of actor?

**URL:** <https://forums.unrealengine.com/t/how-to-compare-multiple-players-that-are-using-the-same-type-of-actor/444086>\
**Category:** Multiplayer & Networking\
**Tags:** compare, unreal-engine, Multiplayer, Blueprint, question\
**Created:** [February 25, 2019, 1:54pm UTC](https://forums.unrealengine.com/t/how-to-compare-multiple-players-that-are-using-the-same-type-of-actor/444086 "2019-02-25T13:54:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_78db8194](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_78db8194](https://forums.unrealengine.com/u/anonymous_user_78db8194)\
**Post date:** [February 25, 2019, 1:54pm UTC](https://forums.unrealengine.com/t/how-to-compare-multiple-players-that-are-using-the-same-type-of-actor/444086/1 "2019-02-25T13:54:59Z")

</div>

Lets say you wanted to make a online first person shooter game and used a integer variable to keep track of score. And after a certain amount of time you wanted to give the player with the highest score a weapon, how would you go about getting that actor alone?

Right now the score value is stored in my actor, And I’m trying to compare them in my gamemode.

 ![269524-compare.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/a/99a4fdb969c2cecf6bf6e803a6088edca7deef62.png)

Also would it be more optimal to save it to a playerstate/player controller? But even then how would you get the highest value of them and compare it?

---

<div class="post-metadata">

**Author:** ![KristofMorva](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kristofmorva/32/1194508_2.png) [@KristofMorva](https://forums.unrealengine.com/u/KristofMorva)\
**Post date:** [February 25, 2019, 3:56pm UTC](https://forums.unrealengine.com/t/how-to-compare-multiple-players-that-are-using-the-same-type-of-actor/444086/2 "2019-02-25T15:56:55Z")

</div>

Score is typically a PlayerState variable.

The logic to select the maximum score is something like this:

 ![269588-max.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/2/9624ff0b363933dd5565fca89a41d701fdb0383f.png)

Of course you can handle separately if the PlayerArray is empty, you can avoid checking the first element by starting with index 1 ( `ForLoop` ), etc, I just made it fast so you can understand the logic behind selecting a maximum element from a list.

---

<div class="post-metadata">

**Author:** ![Jakesmeef03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jakesmeef03](https://forums.unrealengine.com/u/Jakesmeef03)\
**Post date:** [March 31, 2025, 3:11pm UTC](https://forums.unrealengine.com/t/how-to-compare-multiple-players-that-are-using-the-same-type-of-actor/444086/3 "2025-03-31T15:11:18Z")

</div>

I followed this and adjusted it for my game, when the timer reaches 0 I want the players to be shown whether they’ve won or lost, I have this for getting the best player but how can I get the other players? I’m new to multiplayer games in unreal

 ![Screenshot 2025-03-31 160330](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/b/d/cbd0ec757dc058830b1322d59acda3e755145026.png)
