You can write your topic however you want, but you need to answer these questions:
-
I’m trying to make a music system. Keep it simple and clear!
-
The issue is the first sound plays, but the second one does not. Include screenshots / videos if possible! The second sound does this https://gyazo.com/e00d16854594bb23a45a4d848c02393e
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried to wait for the audio to load, but it just gets softlocked, so no matter what I do it doesn’t work, I’ve tried looking on devhub, nothing has really helped, and dev forum, no articles.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local soundtable = {5160230627,4734983736}
local songrequesttable = {}
local sound = Instance.new("Sound",game.Workspace)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local SongChange = ReplicatedStorage.SongChange
sound.Looped = false
while #songrequesttable == 0 do
for i,v in pairs(soundtable) do
sound.SoundId = "rbxassetid://" .. v
if not sound.IsLoaded then sound.Loaded:Wait() end
SongChange:FireAllClients(v)
sound:Play()
sound.Ended:Wait()
table.remove(soundtable,i)
print("Song finished, swapping to next")
end
end
while #songrequesttable >= 1 do
for i,v in pairs(songrequesttable) do
sound.SoundId = "rbxassetid://" .. v
if not sound.IsLoaded then sound.Loaded:Wait() end
SongChange:FireAllClients(v)
sound:Play()
sound.Ended:Wait()
table.remove(songrequesttable,i)
print("Song finished, swapping to next")
end
end
ReplicatedStorage.SongRequest.OnServerEvent:Connect(function(id)
--add a prompt to make them buy a dev product--
table.insert(songrequesttable,#songrequesttable + 1,id)
print("test")
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Sorry if I annoy you devforum :C