Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i play random songs?

Asked by 9 years ago

I want a script so that whenever i press a button my my boombox it plays a random song out of the list Here is the script...

local songs = {184745270}
local ransong = 0
script.Parent.ClickDetector.MouseClick:connect(function()
    ransong =  math.random(1,#songs)
    script.Parent.Parent.MusicPart.Music.SoundId = ("http://www.roblox.com/asset/?id="..ransong)
    script.Parent.Parent.MusicPart.Music:Play()
end)
0
This doesnt work for some reason can you help me? AllianceScripter 30 — 9y
0
You only have a single ID in the list... Perci1 4988 — 9y
0
Im adding more later on xD AllianceScripter 30 — 9y
0
Well if you're trying to play a random song but have only a single song, obviously the song will not be random. Perci1 4988 — 9y

Answer this question