# \[Feature request\] Get player name in Verse

**URL:** <https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109>\
**Category:** Feedback & Requests\
**Tags:** FeatureRequest, unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [November 10, 2023, 12:06pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109 "2023-11-10T12:06:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eternalme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eternalme/32/474875_2.png) [@eternalme](https://forums.unrealengine.com/u/eternalme)\
**Post date:** [November 10, 2023, 12:06pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/1 "2023-11-10T12:06:11Z")

</div>

```auto
GetName(Player : player)

```

Or similar to get players nickname.

This would allow us to make custom score/leader boards with own UI and tracking strategies and many more.

---

<div class="post-metadata">

**Author:** ![LionUnchained](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lionunchained/32/1039015_2.png) [@LionUnchained](https://forums.unrealengine.com/u/LionUnchained)\
**Post date:** [November 10, 2023, 5:57pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/2 "2023-11-10T17:57:57Z")

</div>

In case you’re looking for a workaround on how to do that now:

> [@How do you get the player names?](https://forums.unrealengine.com/t/how-do-you-get-the-player-names/1153016/4):
>
> Tried to look into it, and found out you can link a Trigger Device with a HUD Message Device and call the Trigger function through Verse The Trigger Device needs to setup You have to Add the OnTriggered Event from the Trigger Device to the “User Options - Functions” on the HUD Message Device Then from Verse you need a reference to the trigger device, and call .Trigger(Player) on it If you change the message in Verse, you can’t use {instigatorname} as Verse doesn’t have access to that variabl…

---

<div class="post-metadata">

**Author:** ![bananna\_manuk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bananna\_manuk](https://forums.unrealengine.com/u/bananna_manuk)\
**Post date:** [November 10, 2023, 7:09pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/3 "2023-11-10T19:09:26Z")

</div>

We do it like this then store the playernames in an array

```auto
    var PlayerNames : []message = array{}
    PlayerNameToMessage<localizes>(Agent:agent):message="{Agent}"

    GetPlayerName(): void=
       
        Players := GetPlayspace().GetPlayers()
            for(found : Players):
                    CurrentPlayerName : message = PlayerNameToMessage(found)
                    set PlayerNames = PlayerNames + array{CurrentPlayerName} 

```

we store the names as messages rather than strings so we can show them in text blocks

---

<div class="post-metadata">

**Author:** ![eternalme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eternalme/32/474875_2.png) [@eternalme](https://forums.unrealengine.com/u/eternalme)\
**Post date:** [November 13, 2023, 8:54am UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/4 "2023-11-13T08:54:04Z")

</div>

This is dope. Tnx. I hope its not a lucky accident that will break in next updates =D

---

<div class="post-metadata">

**Author:** ![eternalme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eternalme/32/474875_2.png) [@eternalme](https://forums.unrealengine.com/u/eternalme)\
**Post date:** [November 14, 2023, 11:40am UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/5 "2023-11-14T11:40:44Z")

</div>

It seems the nick name is only correct for the player him self, other are shown as Anonymous[XXX] 😕

---

<div class="post-metadata">

**Author:** ![TCGameStudio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TCGameStudio](https://forums.unrealengine.com/u/TCGameStudio)\
**Post date:** [April 30, 2024, 3:27am UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/6 "2024-04-30T03:27:12Z")

</div>

Has this been resolved?

Trying to create a top 5 leaderboard, but all the names have Anonymous. It’s totally ridiculous that in order to get a top 5 leader board you need 5 overlapping Billboards. Why doesn’t Epic resolve this?

```
GetTop5():void=
    AllPlayers := GetPlayspace().GetPlayers()
    var id:int = 0
    var x:playerScore = playerScore{Score:=0}
    Scores:[]playerScore =
        for (Agent : AllPlayers, TeamPlayer := player[Agent]):
            if (Value:=PlayerMap[TeamPlayer]):
                set id += 1
                Value.SetID(id)
                set x = playerScore{Score:=Value.Score, PlayerId:=id}                    
            else:
                set x = playerScore{Score:=0, PlayerId:=0}
    Sorted := Sort(Scores, false, CompareScores)
    var lastIndex:int = Sorted.Length
    if (lastIndex > 5):
        set lastIndex = 5

    var Lines:[]string = array{"","","","",""}
    for (Index := 0..lastIndex - 1):
        if (Item := Sorted[Index]):
            for (Agent : AllPlayers, TeamPlayer := player[Agent]):
                if (Value:=PlayerMap[TeamPlayer]):
                    Pid:=Value.GetID()
                    if:
                        Item.PlayerId = Pid
                    then:
                        S:=Localize(ScoreText(Index + 1, TeamPlayer, "{Item.Score}"))
                        if (set Lines[Index] = S) {}

    if:
        Billboard1:=BillboardRanks[0]
        Billboard2:=BillboardRanks[1]
        First:=Lines[0]
        Second:=Lines[1]
        Third:=Lines[2]
        Fourth:=Lines[3]
        Fifth:=Lines[4]
    then:
        Billboard1.SetText(Top5Text(First, Second, Third, Fourth, Fifth))
        Billboard2.SetText(Top5Text(First, Second, Third, Fourth, Fifth))

```

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 27, 2024, 7:35pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/7 "2024-05-27T19:35:36Z")

</div>

hi @TCGameStudio ,  
Looks like there is a post/article in  
[The Chicken Test: Verse Code to Check if an Agent is a Fortnite Player or Character](https://dev.epicgames.com/community/learning/tutorials/q4mr/the-chicken-test-verse-code-to-check-if-an-agent-is-a-fortnite-player-or-character)

the source code has been extracted using Screen Grab to MS Paint / Crop the code from the video save as file. Import file into MS Snipping Tool then use the Text Conversion tool.  
Clicking “Copy Text” and post below

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Characters}
using { /Fortnite.com/Playspaces}
using { /UnrealEngine.com/Temporary/UI}
using { /Fortnite.com/UI}
using { /UnrealEngine.com/Temporary/SpatialMath}

# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.

# A Verse-authored creative device that can be placed in a level
check_if_player := class(creative_device):

#creates a reference to the trigger device, variable name is MyTrigger/
Geditable
MyTrigger : trigger_device - trigger_device(}

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

MyTrigger.TriggeredEvent.Subscribe(CheckStatus) #we reference the trigger device thru the MyTrigger variable, access its method and subscribe or bind to our fx.

# this ?agent assigns to Agent, then queries to assign to ValidAgent, reassigns to Player and calls GetFortNight character. If true, then we know it is.
CheckStatus(Agent :? agent): void =
if(ValidAgent := Agent?, Player := player[ValidAgent], Player.GetFortCharacter[]):
Print("This is a Fortnite Character.")

else:
Print("This is not a Fortnite Character.")

```

---

<div class="post-metadata">

**Author:** ![HYPER\_XD2007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HYPER\_XD2007](https://forums.unrealengine.com/u/HYPER_XD2007)\
**Post date:** [July 15, 2024, 5:53pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/8 "2024-07-15T17:53:53Z")

</div>

I know that Localize() returns Anonymous[xxx], but have you tried using “\< computes \>” instead to get the username?

```auto
Name<localizes> (Agent:agent)<computes>: message = "{Agent}"

SetBillboardToPlayerName(Billboard : billboard_device, Agent:agent):void=
     Billboard.SetText(Name(Agent))

```

I don’t really know how you want to implement it into your code, but maybe this helps out!

---

<div class="post-metadata">

**Author:** ![latunda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/latunda/32/1047041_2.png) [@latunda](https://forums.unrealengine.com/u/latunda)\
**Post date:** [July 15, 2024, 7:59pm UTC](https://forums.unrealengine.com/t/feature-request-get-player-name-in-verse/1378109/9 "2024-07-15T19:59:54Z")

</div>

This is against the rules to access and store player names. Currently it is possible to pass agent in messages and ui where it is substituted. So you can still build your custom leaderboards etc.
