Enable Skill if certain Weapon is equiped

Hello, 


was looking here 





but its already closed and I can't get it to work.


I've tested every code in the topic but it wont work.


As cross check I've used that code from the help:


<Custom Requirement>
if ($gameParty.gold() > 1000) {
value = true;
} else {
value = false;
}
</Custom Requirement>


Which works fine.


But 



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


doesn't work (the skill is disabled). 


The actor ID is 5 and the Weapon ID is 5 which he is wearing. 


Any suggestions? 
Can always fudge it a little and have the player choose in a menu "Sword, Gun, ect" then change the character to an identical one that fits his/her choice.
If you want a weapon requirement, then do it with the default and ignore all those script references.


Simply make that weapon with a unique weapon type that isn't used for a different weapon, add that weapon type to anyone who should equip it and place it in the "required weapon" part of the skill.


The scripts/plugins in the other topic were only needed because that poster wanted an armor as a requirement.
If you want a weapon requirement, then do it with the default and ignore all those script references.


Simply make that weapon with a unique weapon type that isn't used for a different weapon, add that weapon type to anyone who should equip it and place it in the "required weapon" part of the skill.


The scripts/plugins in the other topic were only needed because that poster wanted an armor as a requirement.



That was my first thought but I have only limited Weapon Types.. maybe I need them later. Don't know why they restricted so many things in the Database. Is there a API/JS Documentation anywhere? The one in the help is crap, you can't even search.
??


99 weapon types are not enough for you? Then you should perhaps rethink how you organised your weapon types, because even if you have two or three dozen special wreapon types for these cases the rest should be enough for regular weapons.


You can't give each weapon a unique weapon grafic in sideview, but there are more types allowed than just one per weapon animation sequence (which is limited to 30 iirc)
??


99 weapon types are not enough for you? Then you should perhaps rethink how you organised your weapon types, because even if you have two or three dozen special wreapon types for these cases the rest should be enough for regular weapons.


You can't give each weapon a unique weapon grafic in sideview, but there are more types allowed than just one per weapon animation sequence (which is limited to 30 iirc)



Oh Gosh! Sorry, I forgot to look at Types  ;_;   (manchmal sieht man den Wald vor lauter Bäumen nicht.. - German saying) ofc 99 weapon types are enough 😛   maybe I forgot it because of the restriction of the unique weapon grafic. But in this case its ok. Thanks for the hint.. 

Original thread: https://forums.rpgmakerweb.com/threads/enable-skill-if-certain-weapon-is-equiped.61251/