So I look up how to make a music system It showed nothing to help me I watch 14 Vids Can I get some advise how to setup a music system?
Iāve written a sample script below. Itās untested so it may not work, but this is probably how Iād go about writing this. Basically, āSoundEmitterā is the part where all of your music tracks are located, put as many in there as you want. Store this Script in ServerScriptService, and it should do the rest automatically.
Hope this helps. I didnāt add commenting as I figured you needed this just for the functionality aspect.
local soundtracks = workspace.SoundEmitter:GetChildren()
local soundtrack_index = 1
local function Play_Soundtrack()
local sound = soundtracks[soundtrack_index]
sound:Play()
local connection
connection = sound.Ended:Connect(function()
soundtrack_index = (soundtrack_index + 1 > #soundtracks and 1) or soundtrack_index + 1
Play_Soundtrack(soundtracks[soundtrack_index])
connection:Disconnect()
end)
end
Play_Soundtrack(soundtracks[soundtrack_index])
This may not seem like help at all, but i recommend just trying things that you think will work. Trial and error and referencing the catalog APIās.
Alright thanks I will check it out.
Does it only work in game are both?
It should either way.
-30chars-
I donāt hear anything Are should I try it in game?
My bad, make āSoundEmitterā a Folder or something, not a brick.
Ik this a waste of your time but like how do I make a folder I forgot.
If you right-click on the Explorer window, hit āInsert Objectā, then find āFolderā. Name it āSoundEmitterā, and store all your music in it.
Ok is there any scripts I need do are do I just start puting Ids.
I playtested the code right now and it works good. All you need to do is put all the soundtracks you want in the folder and the script should do the rest
Do I add a script to the folder and start putting music ids?
Make a script with the code I gave you, and put the script in ServerScriptService
.
Put the āSoundEmitterā folder into workspace, and then at that point load it up with whatever soundtracks you want. Input the ID of the music you want into various āSoundā objects.
Ok lol I just notice u co-owner of Walmart lol
I have a question are u busy to help me dev my bakery?
Just let me know if your interested.
Hello! I followed what you said but it is not working.
I put the script in Server Script Service and then made a folder at workspace named āSoundEmitterā and made Sound and put the IDS.
Hey man, it worked for me just a moment ago thought. Did you look at the capitals and where youāve put them?