# How to end a round of Game with end\_game\_device on Verse?

**URL:** <https://forums.unrealengine.com/t/how-to-end-a-round-of-game-with-end-game-device-on-verse/1365680>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [November 5, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-end-a-round-of-game-with-end-game-device-on-verse/1365680 "2023-11-05T15:41:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyuFuru12121](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyuFuru12121](https://forums.unrealengine.com/u/RyuFuru12121)\
**Post date:** [November 5, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-end-a-round-of-game-with-end-game-device-on-verse/1365680/1 "2023-11-05T15:41:21Z")

</div>

Hi,

I would like to question how to use end\_game\_device on Verse code.  
Please see the following code:

```auto
prop_teleport := class(creative_device):

    @editable
    EndRound<public> : end_game_device = end_game_device{}

    OnBegin<override>()<suspends>:void=
        Playspace: fort_playspace = GetPlayspace()
        AllPlayers: []player = Playspace.GetPlayers()

       for (Agent : AllPlayers):
            EndARound(Agent)

    EndARound<private>(Agent:agent)<suspends> : void =
        EndRound.Activate(Agent)

```

In my test, if the first playter exit this game, other player’s round never end (Maybe because the first player exit, the first loop of `for` cause Error and the later process is not executed.

How can I end a round even if any player in this game exit during Game playing?

Regards,

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [November 5, 2023, 4:33pm UTC](https://forums.unrealengine.com/t/how-to-end-a-round-of-game-with-end-game-device-on-verse/1365680/2 "2023-11-05T16:33:57Z")

</div>

You’re trying to end the round as soon as the game begins… I’m not sure if the EGD is even properly instantiated at that point.

Either way, you wouldn’t put it in a loop, you’d find the player you want to be the agent to activate the device and then use just that one player. If there was only one player in the game and you ran that loop (not in the OnBegin) then it should end the round/game if you have hooked up the EGD in your editables and device.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 5, 2023, 4:34pm UTC](https://forums.unrealengine.com/t/how-to-end-a-round-of-game-with-end-game-device-on-verse/1365680/3 "2023-12-05T16:34:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
