I want to make it so that every time someone boxes, boxing gloves are given. What I have so far is:
Code:
if (c.duelRule[14] && c.duelRule[16]) { // add boxing gloves
c.getItems().wearItem(Misc.random(1) == 1 ? 7971 : 7973, Config.WEAPON);
}
Code:
if (c.duelRule[14] && c.duelRule[16]) { // remove boxing gloves
c.getItems().wearItem(-1, Config.WEAPON);
}
But I'm guessing that since the rule is made so no items are allowed to be worn, it is blocking it from giving the players the items. How would I fix that?
The rules (14 & 16 are as follows):
Code:
if (c.duelRule[14] && targetSlot == 3) {
c.sendMessage("Wielding weapons has been disabled in this duel!");
return false;
}
Code:
if (c.duelRule[16] && (targetSlot == 5 || is2handed(wearID))) {
c.sendMessage("Wearing shield/2h has been disabled in this duel!");
return false;
}