Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Putting songs 1 and 2 together in my game?

I can put a song in my game, but its not the full song I need to put the other part of the song in and play it right after its over. I don't know how to put the song in order part one to part 2 with it blending in not a big space in between songs.

1 answer

FIRST OF EVERYTHING, YOU SHOULD POST AN ATTEMPT. Altough, once it's your first time... ça va.

Assuming you have an hierarchy like this: A model (or a folder) where the two songs and the script below are.

First, you should check if the songs are not looped.

script.Parent.MusicPartA.Looped = false
script.Parent.MusicPartB.Looped = false

If this property is true, the parts will repeat individually.

Then, its time to play them:

script.Parent.MusicPartA:Play()
wait(--the time the partA lasts in seconds)
script.Parent,MusicPartB:Play()

Simple. If you want to repeat the whole music again and again, just add the while true do:

while true do
script.Parent.MusicPartA:Play()
wait(--the time the partA lasts in seconds)
script.Parent,MusicPartB:Play()
wait(--the time the partB lasts in seconds)
end

WHOLE SCRIPT:

script.Parent.MusicPartA.Looped = false
script.Parent.MusicPartB.Looped = false
while true do -- remove if you do not want to repeat
script.Parent.MusicPartA:Play()
wait(--the time the partA lasts in seconds)
script.Parent,MusicPartB:Play()
wait(--the time the partB lasts in seconds)
end -- remove if you do not want to repeat

This discussion is preserved as it was. New answers, comments, and votes are closed.