Originally Posted by
Giraffe
Thanks, that worked. How would I go about making it also check the head slot and bank for the Jack Lantern mask? I want to make sure players only get one mask.
Not sure how you would do it on your source but should be the same hopefully :
Code:
if (player.getBank().contains(9920, 1) {
//They contain a jack lantern mask in their bank.
}
For head slot :
Code:
if (player.getEquipment().get(Equipment.SLOT_HELMET) != null && player.getEquipment().get(Equipment.SLOT_HELMET).getId() == 9920) {
//Player is wearing a jack lantern mask
}
You should make the whole check by using nested if statements (if statements inside one another) to make the check to make sure they haven't got one in their bank and equipment and inventory then add it. If you want to send a message, after the if (player.getBank()... etc, after the bracket that closes that if statement, just do like
Code:
} else {
//Send message here saying you already have that in your inv/bank/equipment whatever.
}
Hope i helped in some way or the other