Enable skill when equip a weapon/armor

Hi~~


I want to have a learned skill "enabled" when equip a weapon/armor,


otherwise the skill will be showed but "disable"


I had searched for many plugins, but just cannot figure out


Any recommend or hint?


Thanks
 
In database chose weapon > add traits > tap skill > add skill
yanfly skill core


put this in its notetags


<Custom Requirement>
value = false;
for (i = ; i < user._equips.length; i++) {
if (user._equips._dataClass == 'armor' && user._equips._itemId == 1) value = true;
}
</Custom Requirement>


you can change 'armor' to weapon.


you can change the item id to its Id.
In the skill tab of the database, at the bottom you can set equipment type requirements for each skill.
In database chose weapon > add traits > tap skill > add skill

For this, the skill may be added and showed ONLY when equip?


But if I want the skill can be showed but just "ENABLE"?

yanfly skill core


put this in its notetags



<Custom Requirement>
value = false;
for (i = ; i < user._equips.length; i++) {
if (user._equips._dataClass == 'armor' && user._equips._itemId == 1) value = true;
}
</Custom Requirement>


you can change 'armor' to weapon.


you can change the item id to its Id.





Thank you for this, but I have tried

<Custom Requirement>


value = false;


for (i = ; i < user._equips.length; i++) {


if (user._equips._dataClass == 'weapon' && user._equips._itemId == 1) value = true;


}


</Custom Requirement>

But it showed Syntax Error  Unexpected token ;


Can any fix?
you can do it with weapons require but not armors


database > skills > required weapon


you need try yanfly skill core 😉
<Custom Requirement>
value = false;
for (i = 0; i < user._equips.length; i++) {
if (user._equips._dataClass == 'weapon' && user._equips._itemId == 1) value = true;
}
</Custom Requirement>


my bad, this is the right one.
<Custom Requirement>
value = false;
for (i = 0; i < user._equips.length; i++) {
if (user._equips._dataClass == 'weapon' && user._equips._itemId == 1) value = true;
}
</Custom Requirement>


my bad, this is the right one.



Well, there is no error now, but the skill doesn't "enable"  


I tried this 

<Custom Requirement>
value = false;
if ($gameActors.actor(1).equips().contains($dataWeapons[1]) ) {
value = true;
}
</Custom Requirement>

 



It works!!!  but when actor 1 has weapon 1, every member could use the skill   HaHa..............
did the user have the weapon id 1 equip?
sure 
<Custom Requirement>
value = false;
for (i = 0; i < user._equips.length; i++) {
if (user._equips._dataClass == 'weapon' && user._equips._itemId == 1) value = true;
}
</Custom Requirement>


try this one
<Custom Requirement>
value = false;
for (i = 0; i < user._equips.length; i++) {
if (user._equips._dataClass == 'weapon' && user._equips._itemId == 1) value = true;
}
</Custom Requirement>


try this one





This work!!!!!!!!   <3 <3 <3

Original thread: https://forums.rpgmakerweb.com/threads/enable-skill-when-equip-a-weapon-armor.59433/