local sound1 = 1598521629
local sound2 = 2177911889
local sound3 = 482593735
local sound4 = 463568113
local music = script.Parent
while true do
wait()
music.SoundId= "rbxassetid://"..sound1
music:play()
music.Ended: wait()
music.SoundId= "rbxassetid://"..sound2
music:play()
music.Ended: wait()
music.SoundId= "rbxassetid://"..sound3
music:play()
music.Ended: wait()
music.SoundId= "rbxassetid://"..sound4
music:play()
music.Ended: wait()
repeat
Is it possible that the reason it isn’t working has something to do with the properties, and not the script itself?
I don’t think the code got formatted properly, half of the script is plaintext.
As for the soundtrack system, check the output. Are there any errors saying something along the lines of “X failed to load?” If that’s the case, it means you’re setting the IDs incorrectly somehow.
If that’s not the issue, where is the script/sound located?
No, I don’t seem to be getting any errors in the output.
Here’s the location of the script and sound.
When I played around with it, I could get both audios to work. However, for some reason, it took like two minutes for the first sound to change to the second sound.
How long are you waiting to see if the sound system is actually working? If the first song starts before the client joins, you won’t hear it until it’s restarted. Try adding wait(5)
at the beginning of the script.
@ChipioIndustries
Sorry for the late reply.
It worked the first time, but the second time, the script decided to play the song that is the parent. I think the issue has something to do with the way I placed the sounds and script in the browser, but I have no idea what.
Could you try posting your code again but instead put the whole script and format it properly (as mentioned earlier)? Post your code between a code block.
```lua
-- Your code
```
This way, we can read your code more easily and look into a potential solution for your code. As it stands now, I can already see several issues and bad practices - including the way you’ve hard coded a “playlist”, the fact that you are using deprecated functions and have other issues that have to be fixed.
I am currently on my phone, so I can’t give the best response.
How about changing this:
To end
? Maybe that could fix it.
Maybe try this
local SoundTable = {00000000,000000000,00000000} --Put song id's here
local soundInstance = script.Parent
local songnumber = 0
while true do
if songnumber + 1 > #SongTable then
songnumber = 1
else
songnumber = songnumber + 1
end
soundInstance.SoundId = rbxassetid://..SoundTable[songnumber]
wait(0.5)
songInstance:Play()
wait(songInstance.TimeLength)
end