Closing as not a bug, you misunderstand how 'Wait' works. It doesn't pause all the events. 'z = 0' is true all the time, so every tick (60 times a second) you're queuing up a new 'wait 3 seconds then set z to 1' command. The next event then starts conflicting with that since it is every tick (60 times a second) also queuing up a new 'wait 5 seconds then set z to 0' command. Solution: add 'trigger once' to both events.