Please help with global variables!

I don’t know how to change my global variables in this script. It runs both the second and third “if” statements when the program runs. It should not do the second if after the first loop. Thanks for helping. This is unfinished

Try using ‘==’ instead of ‘=’ inside your ifs.

The reason the code isn’t working is because the statement isn’t evaluating, because there’s no condition. You’re setting mood to a new value, not checking if the variable is equal to a new value.

Here’s our lesson on conditions:
arcbotics.com/lessons/controls/i … onditions/

All that said, this would be an excellent place to use switch statements:
arcbotics.com/lessons/controls/s … tatements/