Can delete now, not sure how to
Else if statements are only run if the previous statements returned false. In your example, a score of 7 is not less than 2 so it moves to the next statement. Since it is greater than 2, that ‘else if’ block is run, and then NO OTHER ones will run.
The quick solution would be to throw these statements in reverse order. Check if it is greater than 11, then else if greater than 9, then else if greater than 7… down to else if less than 2.
This ensures that every number will fall into the proper category.
Additionally, is there any reason you are passing Random.Range(X,X) as an argument, rather than just X?
1 Like