how to make music play and stop when clicking a sprite
id: 387663
category: Help with Scripts
posts: 30
Feb 26, 2020 00:25:40
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
Hi i'm trying to know how to make music stop and play when I click a sprite? Can someone help? Thanks!
Feb 26, 2020 04:53:43
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
xMystic416
loading
when this sprite clicked
broadcast [ music]
when I receive [ music]for the stop all sounds you can also switch it with the
if <[music] = [off]> then
set [ music] to [on]
play sound [ v] until done
else
set [ music] to [off]
stop all sounds
end
set volume to (0) %if it doesn't work
Feb 26, 2020 12:06:40
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
ok thanks ill try it
Feb 26, 2020 12:15:03
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
wait I can't find the “set music to on” block
Feb 26, 2020 12:20:53
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
it did not work
Feb 26, 2020 12:58:28
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
mstone326
loading
wait I can't find the “set music to on” block
The set music to block is a variable. You have to go to variables and then create a variable called music. A variable can be named anything, always best to name them something that is relevant as in this case.
Try again, the above script should work after you create the variable.
Feb 26, 2020 21:18:30
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
ok thanks mstone326
Feb 26, 2020 21:25:14
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
when i click the sprite it just restarts the song
Feb 26, 2020 21:48:54
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
xMystic416
loading
Can you share it so I can see what is wrong with the script? when i click the sprite it just restarts the song
Feb 26, 2020 22:10:25
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
yeet
the script is on the play/stop music here sprite
the script is on the play/stop music here sprite
Sep 25, 2021 15:30:12
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
Fire-Scourge
loading
how do you pick the song?
Sep 25, 2021 15:42:04
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
Fire-Scourge
loading
nvm
Mar 30, 2022 09:11:35
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
whistle46
loading
when green flag clicked
play sound [ v] until done
pen up
Mar 30, 2022 14:54:20
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
AmazingKeller
loading
hmm maybe
when green flag clicked
forever
end
play sound [ v]
when this sprite clicked
stop all sounds
Mar 30, 2022 15:28:05
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
that wont work since its a forever loop it will play forever hmm maybewhen green flag clickedforever
end
play sound [ v]when this sprite clicked
stop all sounds
Apr 7, 2022 13:33:24
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
RebeccaKi
loading
how do you do the thing where ok so it plays music and then when you click another sprite the music stops playing im trying to make a game
Apr 7, 2022 13:41:28
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
lion334
loading
Guys stop posting here I think it's already solved.
And this Post is 2 years old.
And this Post is 2 years old.
Apr 13, 2022 22:54:06
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
Conduit7
loading
okay so just use this code: Hi i'm trying to know how to make music stop and play when I click a sprite? Can someone help? Thanks!
when green flag clicked
set [isMuted? v] to (0)
forever
play sound [music v] until done
end
when this sprite clicked
if <(isMuted?) = (0)> then
set [isMuted? v] to (1)
set volume to (0) %
else
set [isMuted? v] to (0)
set volume to (100) %
end
Apr 13, 2022 22:55:18
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
Conduit7
loading
just use the same code i already put up lol how do you do the thing where ok so it plays music and then when you click another sprite the music stops playing im trying to make a game
Apr 14, 2022 11:04:36
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
BroOn4tn1t
loading
this has been already solved dude please stop posting on thisjust use the same code i already put up lol how do you do the thing where ok so it plays music and then when you click another sprite the music stops playing im trying to make a game
Apr 14, 2022 15:52:21
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
PCK_Gamer
loading
when this sprite clicked
if <(volume) = [0]> then
set volume to (100) %
else
set volume to (0) %
end
when green flag clicked
repeat until <>
play sound [Rick astley - Never gonna give you up.MP3 v] until done
end
Jul 17, 2022 01:00:15
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
FinalDFan
loading
I'm trying to make a game, and what's supposed to happen is that when a sprite is clicked, the music is supposed to sop permanently. But no matter how hard I try, I just can't seem to figure out how to do it. What should I do?
Jul 17, 2022 04:40:21
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
cIoudyness
loading
next time create a new topic for your request. reusing old topics is necroposting and a little bit frowned upon. I'm trying to make a game, and what's supposed to happen is that when a sprite is clicked, the music is supposed to sop permanently. But no matter how hard I try, I just can't seem to figure out how to do it. What should I do?
you can try a repeat until touching mouse and mouse down: play sound or a when sprite clicked: set volume to 0
Jan 21, 2023 18:16:21
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
Linas-T
loading
when this sprite clicked
broadcast [ music]when I receive [ music]for the stop all sounds you can also switch it with the
if <[music] = [off]> then
set [ music] to [on]
play sound [ v] until done
else
set [ music] to [off]
stop all sounds
endset volume to (0) %if it doesn't work
It doesn't work?when this sprite clicked
broadcast [ music]when I receive [ music]for the stop all sounds you can also switch it with the
if <[music] = [off]> then
set [ music] to [on]
play sound [ v] until done
else
set [ music] to [off]
stop all sounds
endset volume to (0) %if it doesn't work
Nov 2, 2023 00:01:28
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
CreamyJusticeOG
loading
I need help with making it where if I click on a sprite it stops and when I click it again I need it to turn back on. If you help you get mentioned in my game
Nov 2, 2023 00:09:12
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
housemuseum
loading
andwhen this sprite clicked
broadcast [ music]when I receive [ music]for the stop all sounds you can also switch it with the
if <[music] = [off]> then
set [ music] to [on]
play sound [ v] until done
else
set [ music] to [off]
stop all sounds
endset volume to (0) %if it doesn't workIt doesn't work?when this sprite clicked
broadcast [ music]when I receive [ music]for the stop all sounds you can also switch it with the
if <[music] = [off]> then
set [ music] to [on]
play sound [ v] until done
else
set [ music] to [off]
stop all sounds
endset volume to (0) %if it doesn't work
you guys are necroposting and it would make better sense to create a brand new topic. I need help with making it where if I click on a sprite it stops and when I click it again I need it to turn back on. If you help you get mentioned in my game
Mar 23, 2024 16:27:12
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
fake_flamingolol
loading
Hello Guys i am making a Simulator game where if you click on a sprite called “Shop” then it will make the background music for outside then stop but when you exit then the shop music will stop and here is the script im using
when this sprite clicked
broadcast [ v]
when I receive [ v]
forever
play sound [ v] until done
end
Mar 23, 2024 17:32:20
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
The_2nd_Peep
loading
when i click the sprite it just restarts the song
when green flag clicked
forever
if <(music) = [on]> then
set volume to (100) %
else
set volume to (0) %
when green flag clicked
forever
play sound [ v] until done
end
when green flag clicked
forever
if <<mouse down?> and <touching [mouse pointer v] ?>> then
if <(music) = [on]> then
set [music v] to [off]
else
set [music v] to [on]
end
end
end
Mar 23, 2024 17:33:43
how to make music play and stop when clicking a sprite
view on scratch
view on legacy ocular
Malicondi
loading
Please stop necroposting, this topic is several years old and is solved.