Yo wassup y’all, so uhm i’ve been trying to make a code to make a playlist on roblox you feel me.
And uh the music ain’t playing unless i enable the playing proprety in the sound. and when its enabled it doesn’t change the song id.
Here’s a screen shot for y’all btw
and here is the code its basic alr
local m = script.Parent
while true do
m:Play()
m.Ended:Wait()
wait(2)
m.SoundId = "rbxassetid://7029099738"
m:Play()
m.Ended:Wait()
wait(2)
m.SoundId = "rbxassetid://7023598688"
m:Play()
m.Ended:Wait()
wait(2)
m.SoundId = "rbxassetid://7029017448"
m:Play()
m.Ended:Wait()
wait(2)
m.SoundId = "rbxassetid://7029024726"
end
You are calling the Play() function immediately after changing the sound ID. The actual length of the sound is initially 0 as the sound data is not loaded yet. Because you are changing the sound ID in a loop, you should just create individual sounds for each sound ID and just play those in order:
local sounds = game:GetService("SoundService"):GetChildren()
while wait(2) do
for i,v in pairs(sounds) do
v:Play()
v.Ended:Wait()
wait(2)
end
end