# How to use "SetText" with a "var" for more than one player? 

**URL:** <https://forums.unrealengine.com/t/how-to-use-settext-with-a-var-for-more-than-one-player/2407849>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [March 22, 2025, 1:03pm UTC](https://forums.unrealengine.com/t/how-to-use-settext-with-a-var-for-more-than-one-player/2407849 "2025-03-22T13:03:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PixelCreative](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PixelCreative](https://forums.unrealengine.com/u/PixelCreative)\
**Post date:** [March 22, 2025, 1:03pm UTC](https://forums.unrealengine.com/t/how-to-use-settext-with-a-var-for-more-than-one-player/2407849/1 "2025-03-22T13:03:09Z")

</div>

FOR EXAMPLE:

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

game_manage_device := class(creative_device):

    
@editable
ButtonUp: button_device = button_device{}

var MyAgentVar: [agent]int = map {}

UpCount(Agent:agent):void=:
if {set MyAgentVar[Agent] += 1}

OnBegin<override>()<suspends>:void=:

ButtonUp.InteractedWithEvent.Subscribe(UpCount)

```

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [March 22, 2025, 3:32pm UTC](https://forums.unrealengine.com/t/how-to-use-settext-with-a-var-for-more-than-one-player/2407849/2 "2025-03-22T15:32:13Z")

</div>

Try to Add this in upcount

```auto
if(not MyAgentVar[Agent]):
   if(set MyAgentVar[Agent]=0){}

```

That should see if its not initialized and if its not to initialize it with a value of 0
