Sound toggle problem

I wanna create a mute button for my game but I have no idea how. I’ve tried many different options. Since there is no toggle sound option like in Construct 2, I created global variable (zvuk) which decides if there is a sound. I tried to change it’s value when I press an object but it doesn’t work. It only mutes the sound but it doesn’t unmute it on second click (because there is no way to exit sub-event so it flips the value back to 0). Any help would be welcome since I am a beginner.

I believe the problem is, both sub-events are triggered one after the other:

If zvuk = 0 you set zvuk = 1 but as soon it become 1, the next sub-event also going to be triggered and set zvuk = 0 again.

Try to use a variable to create a switch and make sure only one of the sub-events is triggered at the time.
solution.png

Thank you so much. It works now.