MV Counting weapons in inventory with a variable

Hello everyone! I need a script command to check how many weapons are in the inventory (just right after a random add weapons command) so I can create a conditional branch that, if 0 weapons are in the inventory, it goes back to the random add weapon command. What I need specifically is a

$gameVariables.setValue(6, $gameParty.members().length)

command, but working for counting how many weapons are in the party/inventory. Can't get what's the precise command. Thank you!
Maybe:
$gameParty.weapons().length
Thank you for the reply! Unfortunately, it doesn't work. What I need is a conditional branch that if party has 1 or more characters AND 1 or more weapons then it execute a teleport; otherwise, if party members is 0 or weapons is 0, it resets all the party and weapons and get back to the add party command
you could try a script in the conditional:

$gameParty.weapons().length > 0 && $gameParty.members().length > 0
EDIT: it works, thank you very much

Original thread: https://forums.rpgmakerweb.com/threads/counting-weapons-in-inventory-with-a-variable.139475/