# Round Settings Device not working

**URL:** <https://forums.unrealengine.com/t/round-settings-device-not-working/1198077>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, editor, question, fortnite\
**Created:** [June 13, 2023, 3:29pm UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077 "2023-06-13T15:29:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LloretMunoz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lloretmunoz/32/725856_2.png) [@LloretMunoz](https://forums.unrealengine.com/u/LloretMunoz)\
**Post date:** [June 13, 2023, 3:29pm UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077/1 "2023-06-13T15:29:45Z")

</div>

Hello, i have a script to make the Round to end when onle keeps one player alive, but when i invoke the EndRound call, with the winner as parameter, in the game it shows me draw. I know actually last standing wins isn’t working, but this should work, dont it?  
i`ll link the code below:  
RoundWinnerController := class(creative\_device):

```
@editable
EndRoundDevice : round_settings_device = round_settings_device{}
var PlayerAlive : int = 0

# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=

    AllPlayers := GetPlayspace().GetPlayers()
    set PlayerAlive = AllPlayers.Length
    
    for (Agent : AllPlayers, Player := player[Agent], FortCharacter := Player.GetFortCharacter[]):
        FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated)

OnPlayerEliminated(Result : elimination_result): void =
    AllPlayers := GetPlayspace().GetPlayers()
    set PlayerAlive = PlayerAlive-1

    Print("DIES")

    if(PlayerAlive = 1):
        Print("End it")
        EndGame()

EndGame(): void =
    Print("Ended")
    AllPlayers := GetPlayspace().GetPlayers()
    for (Agent : AllPlayers, Player := player[Agent], FortCharacter := Player.GetFortCharacter[]):
        if(PlayerHealth := FortCharacter.GetHealth() > 0.0):
            EndRoundDevice.EndRound(Player)

```

Thanks!

---

<div class="post-metadata">

**Author:** ![EV\_WAKA](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EV\_WAKA](https://forums.unrealengine.com/u/EV_WAKA)\
**Post date:** [June 13, 2023, 4:50pm UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077/2 "2023-06-13T16:50:25Z")

</div>

This looks close, but maybe it’s the second-to-last line where you have the health comparison. Try separating this into two expressions so the PlayerHealth is set to FortCharacter.GetHealth( ) first, then compare PlayerHealth \> 0.0. Just a guess.

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [June 13, 2023, 7:09pm UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077/3 "2023-06-13T19:09:04Z")

</div>

> [@LloretMunoz](#):
>
> `set PlayerAlive = PlayerAlive-1`

My eyes burn! It should work if you’re not letting people join while game is in progress and you disable spawn limit but I think a dynamic method would suit more.

Anyway, I’m not sure how to fix your issue but since I don’t use the round\_settings\_device to end rounds in my map I guess it’s not working, if your map is not FFA, you could use the `team_settings_and_inventory_device.TeamOutOfRespawnsEvent()` instead, it should be way easier. And you can call `team_settings_and_inventory_device.EndRound()` to choose the winning team.

---

<div class="post-metadata">

**Author:** ![LloretMunoz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lloretmunoz/32/725856_2.png) [@LloretMunoz](https://forums.unrealengine.com/u/LloretMunoz)\
**Post date:** [June 14, 2023, 8:34am UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077/4 "2023-06-14T08:34:19Z")

</div>

> [@im\_a\_lama](#):
>
> FFA

my game is a FFA and i avoid to join with the round in progress, the script is working. It finish the game so its calling the endRound, but its not getting the player who has won(the player i call as parameter).

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [June 14, 2023, 8:32pm UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077/5 "2023-06-14T20:32:38Z")

</div>

Replace this :

```auto
for (Agent : AllPlayers, Player := player[Agent], FortCharacter := Player.GetFortCharacter[]):

```

by this :

```auto
for (Agent : AllPlayers, Player := player[Agent], FortCharacter := Player.GetFortCharacter[], FortCharacter.IsActive[]):

```

it will call the loop on alive players only, so your last player if everything works fine

---

<div class="post-metadata">

**Author:** ![doh2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@doh2c](https://forums.unrealengine.com/u/doh2c)\
**Post date:** [December 16, 2023, 2:28pm UTC](https://forums.unrealengine.com/t/round-settings-device-not-working/1198077/6 "2023-12-16T14:28:56Z")

</div>

Have you ever managed to credit the win to the last player?
