0
Why isn't it working? :/
9 Answers
+ 1
else if(loottable > 25 && loottable <= 50)
You miss loottable in the RHS.
+ 1
Robin Flickinger , add in every conditional check the variable name again after logical and "&&" operator đ±
+ 1
I meant Right hand side.
You must write the variable name on both sides of the && operator.
+ 1
Robin Flickinger Also you have misspelled the variable name on line 11. Make that correction as well.
+ 1
You can replace all "else if ... " expresion like first one, when you have sorted level ( in our case increase all the time the level.
if(loottable <= 25){
alert("Bronze 1 dropped");
}
else if(loottable <= 50) {
alert("Bronze 2 dropped");
}
else if(loottable <= 75) {
alert("Bronze 3 dropped");
}
else if(loottable <= 86.5) {
alert("Silver 1 dropped");
}
else if(loottable <= 98) {
alert("Silver 2 dropped");
}
+ 1
f(loottable <= 25){
alert("Bronze 1 dropped");
}
else if(loottable > 25 && loottable<= 50) {
alert("Bronze 2 dropped");
}
else if(loottable > 50 && loottable<= 75) {
alert("Bronze 3 dropped");
}
else if(loottable > 75 && loottable<= 86.5) {
alert("Silver 1 dropped");
}
else if(loottable > 86.5 && loottable<= 98) {
alert("Silver 2 dropped");
}
else {
alert("Titania Systems dropped!");
}
U have to use Boolean expression after && ,|| ,! because these operators check for only Boolean operands .Here loottable<=50 returns true if condition is true else returns false
0
Avinesh what is RHS? I am totally a newbie
0
Avinesh ohhh ok i know what u mean, i had it like that before and it didn't work. I will try this again. Thank you!
0
Cool it's workin! Thank you guys!