Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Stopping one sound and starting another
- Burrito997
-
14 posts
Stopping one sound and starting another
So im trying to make a game in which when it starts the game it plays some music forever until it switches to a specific background. So like when it switches to the boss background it stops the music and plays a different sound, how can i do this?
- LoudOrange2001
-
48 posts
Stopping one sound and starting another
after the block where it says change backdrop to…..
put play sound….. forever.
hope this helps
LoudOrange
put play sound….. forever.
hope this helps
LoudOrange
- Burrito997
-
14 posts
Stopping one sound and starting another
but with doing that the previous sound is still playing
- Burrito997
-
14 posts
Stopping one sound and starting another
Bump
i really need this answered
i really need this answered
- PH-zero
-
100+ posts
Stopping one sound and starting another
just dont use a forever block, do it like this:
This should work
This should work

Last edited by PH-zero (June 7, 2014 15:21:44)
- Burrito997
-
14 posts
Stopping one sound and starting another
shouldnt bool be repeat instead otherwise thanks so much
- mathman314
-
100+ posts
Stopping one sound and starting another
Here's another alternative:

Use this to make yourself look smart!

Last edited by mathman314 (June 8, 2014 13:23:39)
- Burrito997
-
14 posts
Stopping one sound and starting another
thanks alot for all your help guys
- Burrito997
-
14 posts
Stopping one sound and starting another
Mathman i tried you way and i doesnt seem to be changing, i put the time in seconds (ex: a 2 minute and 11 second long song is 131) and dont know if that is messing up or i put the code in the wrong place ( i put it in my main sprite) please help 

- RPFluffy
-
1000+ posts
Stopping one sound and starting another
Try this, it is quite easy and a great way to getting into more complex things:
- plopdop1
-
6 posts
Stopping one sound and starting another
you could just use the play sound that doesn't say until finished and then wait however long you want it to be
Last edited by plopdop1 (June 9, 2014 01:01:24)
- Burrito997
-
14 posts
Stopping one sound and starting another
the problem with the scripts you are giving me is that when i get to the boss and the background changes and the main music is still playing it keeps playing until done. Then it starts the boss music, i want it to fade out and then the boss music to start instantly.
- Leonitis
-
11 posts
Stopping one sound and starting another
Here is the best and most effective way to do it! It is also very simple! Here it is:
- MinecraftButterfly
-
7 posts
Stopping one sound and starting another
You Can Do THIS:
When Flag Clicked
Set {VARIABLE} To 0
Repeat Until {VARIABLE = 1
Play Sound {ANY} Until Done
When This Sprite Clicked
Broadcast {MESSAGE}
When I Recive {MESSAGE}
Set {VARIABLE} to 1
Forever
Play Sound {ANY} Until Done
THIS Is probably the most effective way!
When Flag Clicked
Set {VARIABLE} To 0
Repeat Until {VARIABLE = 1
Play Sound {ANY} Until Done
When This Sprite Clicked
Broadcast {MESSAGE}
When I Recive {MESSAGE}
Set {VARIABLE} to 1
Forever
Play Sound {ANY} Until Done
THIS Is probably the most effective way!
Last edited by MinecraftButterfly (May 11, 2016 11:27:35)
- Discussion Forums
- » Help with Scripts
-
» Stopping one sound and starting another