# How to get the amout of the COINS of player?

**URL:** <https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [October 17, 2023, 11:28am UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494 "2023-10-17T11:28:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 17, 2023, 11:28am UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/1 "2023-10-17T11:28:09Z")

</div>

Hello!  
How can I know the amount of the coins of the player?  
I’m using Verse.  
Thank you !

---

<div class="post-metadata">

**Author:** ![SeedohFN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seedohfn/32/720959_2.png) [@SeedohFN](https://forums.unrealengine.com/u/SeedohFN)\
**Post date:** [October 17, 2023, 2:13pm UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/2 "2023-10-17T14:13:28Z")

</div>

Using the `conditional_button_device`, use `.GetItemCount(:agent, :int)` to get the amount of the item the agent has. Here is a quick example:  
You fisrt declare a variable of type `conditional_button_device`

```auto
@editable GoldCounter: conditional_button_device = conditional_button_device{}

```

Then you create a function using `.GetItemCount(:agent, :int)`

```auto
CountGold(Agent: agent): void=
     # Assuming you only inserted gold in the button so the index of gold is 0
     Amount:= GoldCounter.GetItemCount(Agent, 0) 
     Print("{Amount}")

```

---

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 18, 2023, 8:50am UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/3 "2023-10-18T08:50:00Z")

</div>

Thank you for your reply.  
I tried to do this allday but Its not working for my code…  
Everytime I just getting the number \*2147483647 always(maximum of the integar)  
Is the conditional button shoud be inserted 1 coin right?

---

<div class="post-metadata">

**Author:** ![SeedohFN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seedohfn/32/720959_2.png) [@SeedohFN](https://forums.unrealengine.com/u/SeedohFN)\
**Post date:** [October 18, 2023, 11:34am UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/4 "2023-10-18T11:34:14Z")

</div>

Yes you need the insert the coin inside the conditional button so the verse program knows what to count

---

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 18, 2023, 2:30pm UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/5 "2023-10-18T14:30:02Z")

</div>

Yes thank you but Its still not working.  
Its just keep showing me this number and I challenged alot.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/f/56f632746561f453cddf0b890443bb006f5c5f67.png)

---

<div class="post-metadata">

**Author:** ![SeedohFN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seedohfn/32/720959_2.png) [@SeedohFN](https://forums.unrealengine.com/u/SeedohFN)\
**Post date:** [October 18, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/6 "2023-10-18T15:43:30Z")

</div>

I have just tested it and yes I’m getting the same error. It appears that this method is bugged at the time.

---

<div class="post-metadata">

**Author:** ![Ep8Script](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ep8script/32/1170494_2.png) [@Ep8Script](https://forums.unrealengine.com/u/Ep8Script)\
**Post date:** [October 18, 2023, 9:40pm UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/7 "2023-10-18T21:40:28Z")

</div>

You need to disable Infinite Resources in your Island Settings

---

<div class="post-metadata">

**Author:** ![Messiah4213](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/messiah4213/32/764721_2.png) [@Messiah4213](https://forums.unrealengine.com/u/Messiah4213)\
**Post date:** [October 19, 2023, 4:36am UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/8 "2023-10-19T04:36:22Z")

</div>

It worked!!  
Thank you very much!!

---

<div class="post-metadata">

**Author:** ![Afflictor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/afflictor/32/484061_2.png) [@Afflictor](https://forums.unrealengine.com/u/Afflictor)\
**Post date:** [November 28, 2023, 3:26am UTC](https://forums.unrealengine.com/t/how-to-get-the-amout-of-the-coins-of-player/1335494/9 "2023-11-28T03:26:09Z")

</div>

Any ideas on how to display the resource count with commas for example: 5,000,000. I found an example code snippet but I’m not sure how to implement it.

code example here: [Functions to work with ridiculously big numbers. | Uefn Code Snippet](https://dev.epicgames.com/community/snippets/wpbL/fortnite-functions-to-work-with-ridiculously-big-numbers)
