Music does not play when the SoundID is changed

Sup yall
So I’m trying to make a playlist but the code isn’t working proprely.

local m = game.SoundService.Sound
while true do
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://1837879082"
	wait(2)
	print(1)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://5409360995"
	wait(2)
	print(2)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://9048375035"
	wait(2)
	print(3)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://9044565954"
	wait(2)
	print(4)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://1842559618"
	wait(2)
	print(5)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://9047050075"
	wait(2)
	print(6)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://9046862941"
	wait(2)
	print(7)
	m:Play()
	print("okay")
	m.Ended:Wait()
	m.SoundId = "rbxassetid://7029099738"
	wait(2)
	print(8)
end

It prints the “okay” and “1” but doesn’t play the next song and nothing on the output. Any support is appreciated.
(this script is in serverscriptservice)

Does it play the first song. If not, you might have to set it as ‘Playing’, in the sound properties.

yes it does also enabling playing wont do a thing either.

Try getting rid of the print() statments and see if it plays maybe.

still doesn’t play (eeee)aaaaoo

What is the volume of the sound? If it is too quiet you won’t be able to hear it.

.5 why ? (character cap is bad)

When the script tries to play the next sound, does the SoundID change in the sound object?

yes it does change char cap is bad

  • Does the script recognise the sound, in the SoundService?

  • In your other topic it was working. Has it only recently started not working?

yes it does (char cap is bad and stupid)

it started playing the first one, but it doesnt play when the soundid is changed, i tried to fix it on my own but i failed. thats why im here rn.

1 Like

I tested it and i dont know why but when u add wait(1) there the Sound will not play.

It will not play if u do this:

m.SoundId = "rbxassetid://1837879082"
	wait(2)
	m:Play()

But if will play if u do this:

m.SoundId = "rbxassetid://1837879082"
	m:Play()

I dont know why this is happening

1 Like

nope, that just made it worse , now it doesn’t even play the first one.

Is this a Localscript or a ServerScript?

server script why would i make it local if it is in serverscriptservice?

I dont saw the serverscript text wait i will check it again

I dont know why but the Sound dont Plays when u add wait() inside SoundID and Play. So i added Wait after Ended. And insert the Sound to Workspace because i think it will not work in SoundService because its Local. Try it and tell me if it worked

local m = game.Workspace.Sound

while task.wait() do
	
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://1837879082"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://5409360995"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://9048375035"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://9044565954"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://1842559618"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://9047050075"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://9046862941"
	m:Play()
	m.Ended:Wait()
	task.wait(2)
	m.SoundId = "rbxassetid://7029099738"
	
end
3 Likes

Why don’t you make a function in which when you change the ID, you clone the sound object and parent it then remove the old one and :Play() the new one?

Yeah this could work