Armor type check

Hey!


I know there's a way to check weapon type, but is there a way to check armor type? I want to make a script that checks if an actor has same type of armor equipped in every slot (heavy, medium or light armor). This gives an error but is it something like this?:
 


if ($gameActors.actor(1).equips[2].atype_id == 1){

$gameActors.actor(1).addState(1);

}


Edit: I think this is correct but it still gives me a "cannot get atypeid of null" error, anyone know why?


if ($gameActors.actor(1).equips[3].atypeId == 3) {


condition = true;


} else {


condition = false;


}

Original thread: https://forums.rpgmakerweb.com/threads/armor-type-check.68602/