Check if actor has a weapon type equipped

Hello. Is there a way to check if an actor has a weapon type equipped? For example, check if actor is equipped with any sword weapon or any bow weapon.

Greetings
Can you tell us where you want to make the check?

Because skills check that automatically, but for most other cases you'll need a longer script line at minimum
Can you tell us where you want to make the check?

Because skills check that automatically, but for most other cases you'll need a longer script line at minimum
Event call.
If you're talking about a party member, then use this script call:

For XP
Ruby:
$game_party.actors[Position].weapon_id == WeaponID

For VX & VX ACE
Ruby:
$game_party.members[Position].wtype_equipped?(TypeID)

I don't recall the exact event command, that's why I didn't provide it here.
If you're talking about a party member, then use this script call:

For XP
Ruby:
$game_party.actors[Position].weapon_id == WeaponID

For VX & VX ACE
Ruby:
$game_party.members[Position].wtype_equipped?(TypeID)

I don't recall the exact event command, that's why I didn't provide it here.
Thank you very much. I made a little edit in your VXA code tho:

$game_party.members.any? { |mem| mem.wtype_equipped?(x) && mem.id == y }

Where x = weapon type; y = actor's id irrespective of her position in the party.

Original thread: https://forums.rpgmakerweb.com/threads/check-if-actor-has-a-weapon-type-equipped.162670/