Hello there!
I'm attempting to implement a set bonus system to my game, where if the player wears certain sets of clothing, they'll gain a passive state that gives them a bonus. below is the custom passive condition code I tried using to achieve this effect
basically it checks if players is wearing armor 2 OR 3, alongside armor 4 OR 5, but for some reason, whenever I try to run the game with those code in the passive condition, I get a crash
As far as I'm able to tell, I used the "or" operator correctly, so I'm not quite sure what the issue is. Would anyone mind pointing it out to me and how I could fix this?
EDIT 1:
I've also tried the following alternatives for my above code but I still receive and error regarding the or operator
I'm attempting to implement a set bonus system to my game, where if the player wears certain sets of clothing, they'll gain a passive state that gives them a bonus. below is the custom passive condition code I tried using to achieve this effect
JavaScript:
if (user.hasArmor($dataArmors[2])) || if (user.hasArmor($dataArmors[3])) && if (user.hasArmor($dataArmors[4])) || if (user.hasArmor($dataArmors[5])) {
condition = true;
} else {
condition = false;
}
basically it checks if players is wearing armor 2 OR 3, alongside armor 4 OR 5, but for some reason, whenever I try to run the game with those code in the passive condition, I get a crash
As far as I'm able to tell, I used the "or" operator correctly, so I'm not quite sure what the issue is. Would anyone mind pointing it out to me and how I could fix this?
EDIT 1:
I've also tried the following alternatives for my above code but I still receive and error regarding the or operator
JavaScript:
if (user.hasArmor($dataArmors[2])) || (user.hasArmor($dataArmors[3])) && (user.hasArmor($dataArmors[4])) || (user.hasArmor($dataArmors[5])) {
condition = true;
} else {
condition = false;
}
JavaScript:
if (user.hasArmor($dataArmors[2])) || if (user.hasArmor($dataArmors[3])) {
if (user.hasArmor($dataArmors[4])) || if (user.hasArmor($dataArmors[5])) {
condition = true;
} else {
condition = false;
}
else {
condition = false;
}
}