Need some help with checking id of equipped weapon/armor

I need to check if an actor has a specific weapon or armor equipped -- can't use the conditional branch event shortcut because that searches for weapons and armors in inventory as well as equipment.

The script call master list has this but it's not entirely clear to me since I ain't super wise in the ways of code:


if ($gameActors.actor(actorId).equips()[n]) {
return $gameActors.actor(actorId).equips()[n].id;
};

if ($gameActors.actor(actorId).equips()[n]) {
return $gameActors.actor(actorId).equips()[n].name;
};


Would anyone be able to offer an example of how I might specifically be able to check if, say, actor 1 is wielding weapon id 6?

Many thanks! :LZSsmile::LZSexcite::LZSsmile:
can't use the conditional branch event shortcut because that searches for weapons and armors in inventory as well as equipment

Sure you can - sounds like you're using the wrong conditional branch.

Conditional Branch > Tab 2 > Actor (select actor) > Weapon/Armor.

Will return true if that actor has that weapon/armor equipped and false if they don't.

I'm guessing you're using Weapon/Armor on the third page, which just checks if that weapon/armor is in inventory and may or may not include equipped items.
Sure you can - sounds like you're using the wrong conditional branch.

Conditional Branch > Tab 2 > Actor (select actor) > Weapon/Armor.

Will return true if that actor has that weapon/armor equipped and false if they don't.

I'm guessing you're using Weapon/Armor on the third page, which just checks if that weapon/armor is in inventory and may or may not include equipped items.

Goodness gracious, that was simple. Thank you as always Shaz, solved!
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/need-some-help-with-checking-id-of-equipped-weapon-armor.131548/