# Dependant menu troubles

**URL:** <https://forum.makecode.com/t/dependant-menu-troubles/46502>\
**Category:** Help\
**Created:** [October 17, 2026, 1:18am UTC](https://forum.makecode.com/t/dependant-menu-troubles/46502 "2026-10-17T01:18:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KING](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/king/32/35663_2.png) [@KING](https://forum.makecode.com/u/KING)\
**Post date:** [October 17, 2026, 1:18am UTC](https://forum.makecode.com/t/dependant-menu-troubles/46502/1 "2026-10-17T01:18:46Z")

</div>

im trying to use a buy system so you can buy an object in a menu and use it in a diffrent one, the thing is, i dont know how to make dependant menu items, is there code for this?

needing help,

-KING

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [October 17, 2026, 8:35pm UTC](https://forum.makecode.com/t/dependant-menu-troubles/46502/2 "2026-10-17T20:35:25Z")

</div>

You could make an array that is your inventory and when you bux something xou add it to the array. If you want to see your inventory you can loop though the array and create a menu item for each element. If you want to check if you have a specific item you can do `if(inventory.indexOf(item) != -1)`

What kind of objects are they? And are you working in JS or blocks?

---

<div class="post-metadata">

**Author:** ![KING](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/king/32/35663_2.png) [@KING](https://forum.makecode.com/u/KING)\
**Post date:** [October 19, 2026, 8:23pm UTC](https://forum.makecode.com/t/dependant-menu-troubles/46502/3 "2026-10-19T20:23:37Z")

</div>

im using blocks, but here is the code:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/a/a/aa9ad89550ee26c91d93b654e79821bc9189680f.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/1/11ee6d74b19e6baa525a5155a1979ffdd1d933e1.png)
