ID:139568
 
Code:
mob
var
Playing = 0
mob/proc/RandomSong()
usr << pick(Song1(),Song2())
mob
verb
Listen()
set name = "Red Road Radio"
set category = "Radio"
Playing = 0
if(Playing == 0)
Playing = 1
RandomSong()
else
Playing = 0
usr << sound(null)

mob
proc
Song1()
set name = "Jingle Jangle Jingle"
usr << 'MUS_Jingle_Jangle_Jingle.wav'
sleep(2030)
RandomSong()
Song2()
set name = "Blue Moon"
usr << 'MUS_Blue_Moon.wav'
sleep(1740)
RandomSong()


Problem description:
Weeeellll, I click the verb and it plays fine, but then i click it to turn it off and another song starts up in the backround, with the other still playing!
You're setting Playing to 0 before checking the value of Playing. Unsurprisingly, it turns out to be 0.

Also, I would suggest not using pick() like that, even though it works for somewhat silly reasons.
In response to Garthor
dont you sposed to set the Playing = 0 before so the "if" statment can recognize if its 0 or 1?
In response to Kakashi153
No.

Setting a variable to 0 sets that variable to 0.
Code:
mob
> var
> Playing = 0 //This one??
> mob/proc/RandomSong()
> usr << pick(Song1(),Song2())
> mob
> verb
> Listen()
> set name = "Red Road Radio"
> set category = "Radio"
> Playing = 0 //Or this one?
> if(Playing == 0)
> Playing = 1
> RandomSong()
> else
> Playing = 0
> usr << sound(null)
>
> mob
> proc
> Song1()
> set name = "Jingle Jangle Jingle"
> usr << 'MUS_Jingle_Jangle_Jingle.wav'
> sleep(2030)
> RandomSong()
> Song2()
> set name = "Blue Moon"
> usr << 'MUS_Blue_Moon.wav'
> sleep(1740)
> RandomSong()
>

In response to Kakashi153
That one.
In response to Garthor
.>
In response to Kakashi153
The second one.
In response to Hi1
wow i feel stupid (As it is working now) -.-"

but thank you bunches!