How to make a party need several of one item to finish event.

Hello
How would I make it so the player would need to collect X number of an item to complete a quest. I tried a conditional branch but that only checks for the item and I can't set a number for the item.
Thanks in advance.
👋
...you can do this without scripting:
  • To get the number of a specific item, use Control Variables > Game Data > Item;
  • You can then use Conditional Branch > Variable to check the value against a threshold.
Spoiler: Click to see an event example
Code:
◆Control Variables:#0007 Count = The number of Potion
◆If:Count ≥ 5
  ◆Text:None, Window, Bottom
  :    :Yay, you have 5 Potions!
  ◆
:Else
  ◆Text:None, Window, Bottom
  :    :I need 5 Potions for the Ultra Potion.
  :    :You have \v[7] Potions right now.
  ◆
:End

The script equivalent would be something like this (Conditional Branch > Script):
JavaScript:
$gameParty.numItems($dataItems[1]) >= 5
I.e. "return true iff the party has 5 or more of item ID 1". Replace $dataItems with $dataWeapons or $dataArmors if you want to check a weapon or armor instead.

Note that it's often useful to have the number stored in a variable for easy reference in Show Text, as demonstrated in my event example. 🙏
Thank you this is what I needed.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-party-need-several-of-one-item-to-finish-event.131662/