Music Scripting problems

Started by taryuu, Sat 20/09/2003 00:24:32

Previous topic - Next topic

taryuu

allright, so i want the background music to repeat in my room.  however i also want the player to turn off or turn on the music by interacting with an object.  

if(IsMusicPlaying()==0)
PlayMusic(3);
if(IsMusicPlaying()==1)
StopMusic();


however because the music is repeating, it's always going to be 1.  therefore, the player can shutoff the music, but can't turn it on again.

so i tried this

if (GetCurrentMusic()==-1)
PlayMusic(3);
if(IsMusicPlaying()==1)
StopMusic();

still doesn't work.  again the player can't turn it on again.  what can i do to fix this problem?



I like having low self-esteem.  It makes me feel special.
   
taryuu?

Timosity

I haven't tried it but i would imagine something like this might work

if(IsMusicPlaying()==0) {
PlayMusic(3);
}

else if(IsMusicPlaying()==1) {
StopMusic();
}

taryuu

ahhh the old "else" dealie.  thanks man.
I like having low self-esteem.  It makes me feel special.
   
taryuu?

SMF spam blocked by CleanTalk