Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I play random music?

So I am wanting to make a script that plays a random id from a table. the table name is "local ids"

I need this for a shop im making..

1 answer

✓ Accepted answer
local pre = {"268763467","261244793","142570249","165508381"} --Example songs
local whatpre = pre[math.random(1,#pre)]
music.SoundId =("http://www.roblox.com/asset/?id="..whatpre)
music:Play()


2 comments

0

Would I be able to replace "music" with script.Parent or would that not work?

0

It will work.

This discussion is preserved as it was. New answers, comments, and votes are closed.