Mr Love
This is what I have that works with an "animated" switch ( not alternate texture switch )
that I assume your using based on your code from above ??? If it's not animated let me know.
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=55:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=60,plrusingaction=1:state=1,setframe=0,activateifused=1,musicoverride=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2
:state=2,plrusingaction=0:state=3
:state=3,plrdistwithin=60,plrusingaction=1:activateifused=0,state=4
:state=4:decframe=0
:state=4,frameatstart=0:state=5,setframe=0,musicoverride=$1
:state=5,plrusingaction=0:state=10
Place your "music" in slot $0 and leave slot $1 empty.
This worked for me when I already had a background music playing.
And if you don't want to change your background music and just play a sound file, use this..
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=55:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=60,plrusingaction=1:state=1,setframe=0,activateifused=1,loopsound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2
:state=2,plrusingaction=0:state=3
:state=3,plrdistwithin=60,plrusingaction=1:activateifused=0,state=4
:state=4:decframe=0
:state=4,frameatstart=0:state=5,setframe=0,stopsound
:state=5,plrusingaction=0:state=10
My games never have bugs. They just develop random features..
Lots and lots of random features...