Logic gate not working?

game link: https://flowlab.io/game/view/1103002
Hello, so I’m trying to make a questionable thing in my game and for some reason it doesn’t work. I made that if you click 1 on your keyboard it’s going to check if you have a certin amount of coins then it will show you restart the game, I put an alert for testing but still even the alert doesn’t work. What do I do to fix this bug?
Thanks.

heyyy

I, personally, don’t know how to fix this but maybe @grazer could help

It’s because for a AND logic gate to work, you need A and B to active at the same time (or A and B to be on) for the logic gate to work. If you want to use the logic gates like a switch for A and B seperatly, try using an always to in of a switch and out to A and another set for B.

On Switch for A and B:
2019.02.19-15.10

Thanks @“JR 01” , I did what you told me to do and it works fine, but when I click the A / B / C buttons or I get enough coins, it gets stuck on “ON” mode, which I don’t want to happen. What do I do to fix this? Thanks ;D

Oh then you could either:

  • set the output of the gate to off on the switch
  • send a message from the up output on the button
    to off on the switch