Discuss Scratch

Old-man96
Scratcher
4 posts

why does this not work

im trying to make some music for my game but its not working. im trying to make music for the menu but it wont stop playing

when green flag clicked
repeat until <(Game on) = [Y]>
play sound [ quirky-music-cartoon-154978] until done
end
stop all sounds
stop [ This script]

Btw i have tried using
play sound [  quirky-music-cartoon-154978]
but it just plays the sound repeatedly

Last edited by Old-man96 (March 25, 2024 20:18:48)

96498cb
Scratcher
100+ posts

why does this not work

Maybe try changing the play sound until done to play sound?

highlight (double click) a piece of text + control (command on mac) + shift + down arrow key to see my full siggy.
define 96498cb
forever
help forums :: custom
end
Come to this link for awesome code, employees, and service!
100th post!!!!!!!!! https://scratch.mit.edu/discuss/topic/706823/?page=185#post-7670932

This is Mira. She is my siggy protector.
(= ^ •⩊• ^ = :: #aaaaaa)
Hey, I am a small creator that doesn't have a lot of projects, but i would appreciate if you liked and faved them. (you don't have to)
TheRealRldFan
Scratcher
36 posts

why does this not work

Nevermind

Last edited by TheRealRldFan (March 25, 2024 20:01:48)

96498cb
Scratcher
100+ posts

why does this not work

TheRealRldFan wrote:

your ment to do:
when green flag clicked
repeat until <(Your variable here) = (y position)>
play sound [Music here] until done
end
stop all sounds
stop [this script]
not y, he means yes, like a y or n in oregon trail

highlight (double click) a piece of text + control (command on mac) + shift + down arrow key to see my full siggy.
define 96498cb
forever
help forums :: custom
end
Come to this link for awesome code, employees, and service!
100th post!!!!!!!!! https://scratch.mit.edu/discuss/topic/706823/?page=185#post-7670932

This is Mira. She is my siggy protector.
(= ^ •⩊• ^ = :: #aaaaaa)
Hey, I am a small creator that doesn't have a lot of projects, but i would appreciate if you liked and faved them. (you don't have to)
TheRealRldFan
Scratcher
36 posts

why does this not work

96498cb wrote:

TheRealRldFan wrote:

your ment to do:
when green flag clicked
repeat until <(Your variable here) = (y position)>
play sound [Music here] until done
end
stop all sounds
stop [this script]
not y, he means yes, like a y or n in oregon trail
oh
MrKingofScratch
Scratcher
100+ posts

why does this not work

The problem with this is that the full song has to be played, then the script checks if the game started for like a frame, and then it plays the whole song again before checking if the game started again. You can fix this by seperating the script into two seperate chunks:

when green flag clicked
repeat until <(gameon?) = [y]>
play sound [music v] until done
end

when green flag clicked
wait until <(gameon?) = [y]>
stop all sounds
Let me know if this doesn't work- I hope it helped!

Last edited by kaj (Tomorrow 00:00:00)
100th post!
Old-man96
Scratcher
4 posts

why does this not work

MrKingofScratch wrote:

The problem with this is that the full song has to be played, then the script checks if the game started for like a frame, and then it plays the whole song again before checking if the game started again. You can fix this by seperating the script into two seperate chunks:

when green flag clicked
repeat until <(gameon?) = [y]>
play sound [music v] until done
end

when green flag clicked
wait until <(gameon?) = [y]>
stop all sounds
Let me know if this doesn't work- I hope it helped!
Thank you so much it did work I finally can finish my game!!
MrKingofScratch
Scratcher
100+ posts

why does this not work

Old-man96 wrote:

Thank you so much it did work I finally can finish my game!!
Np! Let me know when it comes out!

Last edited by kaj (Tomorrow 00:00:00)
100th post!
Old-man96
Scratcher
4 posts

why does this not work

MrKingofScratch wrote:

Old-man96 wrote:

Thank you so much it did work I finally can finish my game!!
Np! Let me know when it comes out!
it has
https://scratch.mit.edu/projects/946712311

Powered by DjangoBB