Hi there.
I have a scenario in which a sound starts to loop when the player enters a soundzone using this script:
;Triggers
:state=0,plrwithinzone=1:state=1,loopsound=$0
I want this sound to stop looping when the player presses a particular switch. The problem is that I also want the switch to play a sound in the "sound1" property when it is pressed. I tried to edit the switch script by adding a "stopsound" command before "sound1" is played but it didn't work. My scripting knowledge is still pretty poor. Can anyone help me out?
Here is the script I was talking about, I'm guessing it doesn't work simply because the "stopsound" command refers only to sound being played by the entity the script is assigned to.
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextpressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=100:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=100,plrusingaction=1:state=1,setframe=0,plrsound=$0,activateifused=1
:state=1:incframe=0
:state=1,frameatend=0:state=2
:state=2,plrusingaction=0:state=3
:state=3,plrdistwithin=100,plrusingaction=1:state=4,plrsound=$1,activateifused=0
:state=4:decframe=0
:state=4,frameatstart=0:state=5,setframe=0
:state=5,plrusingaction=0:state=10
;End of Script