Hey, I have an issue with my music script, were the music plays on top of each other. I need help fixing this ASAP. Here is the script
while wait(1) do
local m = game.Workspace.Music
game.Workspace.Music.Sound:Play()
script.Parent.Text = "Diviners [NCS Release]"
m.Sound.Ended:Wait()
script.Parent.Text = "Crona - Release"
m.Sound1:Play()
m.Sound1.Ended:Wait()
m.Sound2:Play()
script.Parent.Text = "K-391 - Earth [NCS Release]"
m.Sound3:Play()
script.Parent.Text = "Tonight [NCS Release]"
m.Sound3.Ended:Wait()
m.Sound4:Play()
script.Parent.Text = "Landscape"
m.Sound4.Ended:Wait()
m.Sound5:Play()
script.Parent.Text = "High [NCS Release]"
m.Sound5.Ended:Wait()
m.Sound6:Play()
script.Parent.Text = "Loading"
wait(1)
script.Parent.Text = "Loading."
wait(1)
script.Parent.Text = "Loading.."
wait(1)
script.Parent.Text = "Loading..."
wait(2)
script.Parent.Text = "Loading"
wait(1)
script.Parent.Text = "Loading."
wait(1)
script.Parent.Text = "Loading.."
wait(1)
script.Parent.Text = "Loading..."
end
Thank you!
Don’t do :Play()
instead do m.Playing = true
Okay I will try that, but why would that work and :Play() would not
Because audios have a playing property, and the only way to make a sound play, is by having that property on true
Hey, I tried that, and now the bottom part of the script is giving me errors.
while wait(1) do
local m = game.Workspace.Music
game.Workspace.Music.Sound.Playing = true
script.Parent.Text = "Diviners [NCS Release]"
m.Sound.Ended:Connect(function()
script.Parent.Text = "Crona - Release"
m.Sound1:Play()
m.Sound1.Ended:Connect(function()
m.Sound2.Playing = true
script.Parent.Text = "K-391 - Earth [NCS Release]"
m.Sound2.Ended:Connect(function()
m.Sound2.Playing = true
script.Parent.Text = "Tonight [NCS Release]"
m.Sound3.Ended:Connect(function()
m.Sound4.Playing = true
script.Parent.Text = "Landscape"
m.Sound4.Ended:Connect(function()
m.Sound5.Playing = true
script.Parent.Text = "High [NCS Release]"
m.Sound5.Ended:Connect(function(Load)
m.Sound6.Playing = true
script.Parent.Text = "Loading"
end
m.Sound2.Ended:Connect(function()
m.Sound2.Playing = true
script.Parent.Text = "Tonight [NCS Release]"
m.Sound3.Ended:Connect(function()
You’re playing sound2 again after it ends.
Also I think you forgot to add some end)
statements at the end of your script. I also think this would be a lot more easy to read if you cycled through all of the songs in a loop.
for i = 1, #songs do
songs[i].Playing = true
script.Parent.Text = songs[i].Name
songs[i].Ended:Wait()
end