I want to show the atk value of the weapon which is equipped
how can I do it?
how can I do it?
var actor = $gameParty.members()[0]; // change this number to change member. 0 = member 1, 1 = member 2, etc.
var totalAtk = 0;
var weapons = actor.weapons();
for (var i = 0 ; i < weapons.length; i++) {
totalAtk += weapons[i].params[2];
}
$gameVariables.setValue(20, totalAtk); // change the 20 to the variable ID
$gameActors.actor(1).equips()[0].params[2]+$gameActors.actor(1).equips()[1].params[2]
Note that this only works if the weapons are in the first and second slots (0 and 1) and you have to know if the user is a dual wielder or not because otherwise, you'll be counting shield atk (if any) or whatever is in the slot right after. It's highly encouraged that you use weaons() instead of equips() for that reason. To total up every equipped weapon's atk for single wielders, dual wielders, quad wielders, and whatever else:
Original thread: https://forums.rpgmakerweb.com/threads/how-to-return-the-atk-value-of-weapon.110711/