Skip to main content

else command on the if true/false then command dosent work

Comments

1 comment

  • Debbie Alexander
    Moderator Beacon of Knowledge Super Star

    Hello! I love that you have a user input you are checking. Remember that your if statement is checking what is in that hexagon shape. So "if TRUE then " will always evaluate to TRUE. I think what you are looking for there is "if <my input> = 1 then" and if anything else is said in chat, to do something else, right?

    That on chat command definition at the top (the blue line) is giving a value which will start this code. No other value will start it. For example, if you do the Chicken Rain tutorial, it used the on chat command, and the word there is "chicken" - the code runs when you say chicken. You can have a second set of code which says, "on chat command 'cow' " and also spawn cows! So the word there is unique for each set of code.

    In other words, the only way your code runs is if the input is 1, so it is always true that it is 1, and it never will be anythings else.

    The only way to check for any and all chat is to to use Python Azure Notebooks, which is that blue notebook (another IDE - so not block coding at all, but great stuff!)

    1

Please sign in to leave a comment.