The problem is, when you collide, the events change so quickly that it triggers both events. In your example, on collision, with variable=0, set it to 1. But it is still on collision and now the variable=1, so it triggers the other event and set's it back to 0. The easiest way to solve this, is add a wait event just before you set the variable to its new value. Add a wait 0.1 second and it will solve your issue and it won't be noticeable by players as well.