Custom Requirement - Check If Armor Is Equipped

I've been wrestling with this for hours but I just can't seem to do it.


Basically what I want is to only be able to equip a certain weapon if a specific armor is equipped. I'm decently new to Javascript so I just can't figure it out.


The Error message for this code is:


Syntax Error


Unexpected Identifier


The code I've been using (which is clearly wrong) is right here:


<Custom Equip Requirement Condition>
if $gameActors.actor(1).equips().contains($dataArmors[2]) {
condition = true;
} else {
condition = false;
}
</Custom Equip Requirement Condition>


Technically I think this code is checking a specific actor and I really want it to check whoever is trying to equip the weapon, but if that's not possible then I can live without it.


This code is almost working. The problem is it still only checks one actor and even if my armor with the 2rd id is equipped it doesn't allow the weapon to be equipped.


<Custom Equip Requirement Condition>
if ($gameActors.actor(1).armors().id === 2){
condition = true;
} else {
condition = false;
}
</Custom Equip Requirement Condition>




Here is the script I'm using as well.


http://yanfly.moe/2016/02/27/yep-75-equip-requirements/


If you need more info let me know.


Thanks in advance.

Original thread: https://forums.rpgmakerweb.com/threads/custom-requirement-check-if-armor-is-equipped.63176/