Checking weapon type

how do i do this:


$game_actors[x].equips[y].wtype_id unless $game_actors[x].equips[y] == nil


in javascript?


I just want to check weapon types lol.
If you just want to check whether a certain weapon type is equipped you can do this instead:


$gameActors.actor(ACTOR_ID).isWtypeEquipped(WTYPE_ID)


Which returns true if the specified actor is holding a weapon of the specified type.


This formula reference might be useful
If you just want to check whether a certain weapon type is equipped you can do this instead:


$gameActors.actor(ACTOR_ID).isWtypeEquipped(WTYPE_ID)


Which returns true if the specified actor is holding a weapon of the specified type.


This formula reference might be useful

Sorry for the BUMP, but man! This is quality response! :XP1:

Original thread: https://forums.rpgmakerweb.com/threads/checking-weapon-type.58594/