# KillStreak

**URL:** <https://forums.unrealengine.com/t/killstreak/1238313>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [July 24, 2023, 7:19am UTC](https://forums.unrealengine.com/t/killstreak/1238313 "2023-07-24T07:19:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManuM697](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ManuM697](https://forums.unrealengine.com/u/ManuM697)\
**Post date:** [July 24, 2023, 7:19am UTC](https://forums.unrealengine.com/t/killstreak/1238313/1 "2023-07-24T07:19:39Z")

</div>

so i did this, i know its wrong but im stucked, i want to play the hud message on everyone in the lobby that says something like “Peter is in killstreak of 20 kills”. i dont know if im missing something

using { /Fortnite.com/Devices }  
using { /Fortnite.com/Playspaces }  
using { /Verse.org/Simulation }  
using { /UnrealEngine.com/Temporary/Diagnostics }  
using { /Fortnite.com/Characters }  
using { /Fortnite.com/Game }

Killstreak := class(creative\_device):

```
@editable
HUD:hud_message_device = hud_message_device:

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

    AllPlayers := GetPlayspace().GetPlayers()
    for (EliminationGamePlayer : AllPlayers):
        if (FortCharacter := EliminationGamePlayer.GetFortCharacter[]):
            FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated) # subscribe to eliminated event

OnPlayerEliminated(Result:elimination_result):void=
    Print("Player Eliminated")
    EliminatingCharacter := Result.EliminatingCharacter
    if (FortCharacter := EliminatingCharacter?):
        var killCount : int +=1
        if (killCount > 2):
            HUD.Show()

```

---

<div class="post-metadata">

**Author:** ![2GHSamburskoy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@2GHSamburskoy](https://forums.unrealengine.com/u/2GHSamburskoy)\
**Post date:** [July 24, 2023, 12:24pm UTC](https://forums.unrealengine.com/t/killstreak/1238313/2 "2023-07-24T12:24:12Z")

</div>

This code will not initially work adequately in multiplayer. Here is the code for a solo game with one counter for all players. You need to make a counter for each player.

```auto
@editable
HUD:hud_message_device = hud_message_device:
var killcount : int = 0 ####initialize the variable here

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

    AllPlayers := GetPlayspace().GetPlayers()
    for (EliminationGamePlayer : AllPlayers):
        if (FortCharacter := EliminationGamePlayer.GetFortCharacter[]):
            FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated) # subscribe to eliminated event

OnPlayerEliminated(Result:elimination_result):void=
    Print("Player Eliminated")
    EliminatingCharacter := Result.EliminatingCharacter
    if (FortCharacter := EliminatingCharacter?):
        set killCount : int +=1 #### set the variable here
        if (killCount >= 2):
            HUD.Show()

```

---

<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:** [August 28, 2024, 10:30pm UTC](https://forums.unrealengine.com/t/killstreak/1238313/6 "2024-08-28T22:30:42Z")

</div>

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