Hello, it is me MrSavage261! I am developing a club for my game, and I cannot figure out how to make the radio I am going to put the radio on a stage, and I would like a brick in the radio to play a list of music ( I have 30+) songs selected that I am going to add, and I need a scriot that will make the brick play all the songs, the repeat the script once all of the songs are finished So can someone please write a simple script showing me how to do this! Thank you
This will randomly pick song IDs and then play them.
Make a table that includes the IDs of the songs (for example, local ids = {ID1,ID2,etc..}), then make a function that chooses a random ID from that table: sound.SoundId = "rbxassetid://"..ids[math.random(#ids)]
And then play the sound. After you make the function, you must run it.
Now you want it to run this function when the song ends, which you can do so by: sound.Ended:Connect(function() randomize() end)
This script will loop through the SongList Infinitely.
Just replace the IDs in the table with your IDs.
local Sound = script.Parent:WaitForChild("Sound")
local SongsList = {"rbxassetid://1837324424", "rbxassetid://1845554017", "rbxassetid://1843463175"}
local function PlaySongs()
for Index = 1, #SongsList do
Sound.SoundId = SongsList[Index]
Sound:Play()
wait(Sound.TimeLength)
if Index == #SongsList then
PlaySongs()
end
end
end
PlaySongs()
I agree with @Sonnenroboter, Please do not ask people to write entire scripts. I did this as a one time courtesy.
Requests are not allowed in this category. If you try and have a problem, I’d love to help but I don’t spoonfeed. Give it 1 try, at least and don’t fear to ask when you’re stuck.
I am sorry I will not do this again. I am a medium scripter and I am not good with tables, and when I tried to do this the script would not work, but thank you