if then else

Blitz3D Forums/Blitz3D Programming/if then else

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have music in my game and I wanted the user to be able to toggle it off and on so I wrote this:
If KeyHit (50)=True And musicflag = 0 Then musicflag = .5 Else musicflag = 0
Now the music is playing on a channel and musicflag is the volume represented here:
ChannelVolume play_annoy,musicflag
play_annoy is the music channel. The music loops because in the front of the program I loaded it as:
Global annoy=LoadSound("media/heroloop1.ogg")
LoopSound annoy
play_annoy=PlaySound(annoy)
I can't make this work... it never comes on except for a brief splash as the program starts.

What am I doing wrong?