MV YEP_WeaponUnleash Lunatic JS Support

Good evening,

Utilizing the YEP_WeaponUnleash plugin, I'm attempting to create a script embedded within state 61 that checks to see if the actor is weapon-equipped "Bare Hands". If the actor is bare-handed, their attack command would be replaced by Skill 24. Otherwise, they assume the default attack Skill 1. I found the example script on Yanfly's site, and my failed script is below:

JavaScript:
<Custom Replace Attack>
  if (user.isWtypeEquipped(Bare Hands)) {
    id = 24;
  } else {
    id = 0;
  }
  </Custom Replace Attack>

Community assistance fixing the script is appreciated.

A weapon type is a number, defined in the Types tab of your database, and selected on the Weapons tab of your database.

This is invalid syntax:
Code:
  if (user.isWtypeEquipped(Bare Hands)) {
1 - because the type is a number, and
2 - because Bare Hands is going to make the code look for two variables named Bare and Hands, neither of which exists nor could be used like that with a space between them 😉
3 - if it were a field that could take text, you would need to put it in quotes: "Bare Hands"

So I'm not sure what you're trying to do, based on your use of isWtypeEquipped(). You putting that in there looks like you have actual weapon items that are classified as hands that the actors are equipping.

If that's the case, then you put the appropriate weapon type in the parentheses (as with everything, no leading zero).

If you're trying to see whether the actor has no weapon equipped, then there's no type for you to check, right? You'd do if (user.hasNoWeapons())
If you're trying to see whether the actor has no weapon equipped, then there's no type for you to check, right? You'd do if (user.hasNoWeapons())
This is exactly what I was looking for. Thank you! Solved.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yep_weaponunleash-lunatic-js-support.154075/