# Can't seem to make SetItemCountRequired() work.

**URL:** <https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603>\
**Category:** Verse\
**Tags:** unreal-engine, question\
**Created:** [August 1, 2023, 11:12pm UTC](https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603 "2023-08-01T23:12:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [August 1, 2023, 11:12pm UTC](https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603/1 "2023-08-01T23:12:21Z")

</div>

I’m new to Verse and I would like to use the SetItemCountRequired() function. I don’t understand why it doesn’t work and why UEFN always comes up with an error. Can anyone help

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/9/b0989afb1235dbd3bbd4b6efa3bd8b1e3969c10b.png)

---

<div class="post-metadata">

**Author:** ![ItsJacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/itsjacky/32/913179_2.png) [@ItsJacky](https://forums.unrealengine.com/u/ItsJacky)\
**Post date:** [August 2, 2023, 3:06am UTC](https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603/2 "2023-08-02T03:06:27Z")

</div>

Key item index starts at zero so if you are trying to set the item count for the first item then you should be using:

```auto
ButtonHouse1.SetItemCountRequired(0, 1)

```

---

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [August 2, 2023, 11:13am UTC](https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603/3 "2023-08-02T11:13:16Z")

</div>

thanks but that doesn’t really solve the issue. The function doesnt work

---

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [August 2, 2023, 12:27pm UTC](https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603/4 "2023-08-02T12:27:26Z")

</div>

I found the issue, it had to do with indentation and also moving some things around

---

<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:** [September 1, 2023, 12:27pm UTC](https://forums.unrealengine.com/t/cant-seem-to-make-setitemcountrequired-work/1247603/5 "2023-09-01T12:27:34Z")

</div>

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