How do I check, using code, if the party doesn't have an item?

I've googled this but I only keep finding people asking about checking if the party has an item, not the opposite.
I'm using hime's hide choices, but you need to enter code as a condition to hide a choice. And I'd like to hide some if you don't have an specific item.
Thanks in advance!
Basically, if you know the code to check if the party has an item, the opposite should be possible simply by adding ! before the condition. It should look something like this:

if (!$gameParty.hasItem(item, true))
Well for whatever reason it gave me an error, but someone gave me an alternate solution: use an else.
If party has items 2:
else
hide choice

Thanks alot anyway!
Are you using events or scripts? You said "using code" which implies you want a script, which means what @shockra gave you should work (you've got to use $dataItems[id] where the word item is in that formula).

If you're using event commands, having an else with nothing in the if block is a bit messy. You could use Control Variables to put the number of items held into a variable, and then a conditional branch to see if the variable is 0, which means the party has none of that item.
Well the hime plugin needed to use code: you needed to input "hide_choice( choiceNumber, condition )" as a script code. But, the alternate method I got suggested worked just as well even if it is a bit messy. Thanks a ton for the alternate solution, Shaz. 🙂
Ah, then in that case, you could use either of the following (assuming it's item 2 you're interested in):

Code:
hide_choice( choiceNumber, !$gameParty.hasItem($dataItems[2], true) )
which will hide the choice if the party does not have item 2 (it doesn't matter whether you say true or false here, as that's the argument to tell it to look at equipped items, and you can't equip an item - this would be useful if you were checking armor or weapons and wanted, or didn't want, to include anything that was equipped; in fact, it would probably be better to say false, to avoid the small processing overhead in looking to see if anyone has equipped something that can't be equipped)

or

Code:
hide_choice( choiceNumber, $gameParty.numItems($dataItems[2]) === 0)
which will hide the choice if the quantity of item 2 held is 0. This one does not check for equipped gear.
Thanks a ton, Shaz; that works out perfectly! 😀

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-check-using-code-if-the-party-doesnt-have-an-item.95728/