music = {176407800, 166886402, 183503743, 185698490}
while true do
local id = math.random(1, #music)
script.Sound.SoundId = "rbxassetid://"..id
wait(10)
end
It doesn't do anything and I have no errors. What did I do wrong?
music = {176407800, 166886402, 183503743, 185698490}
while true do
local id = math.random(1, #music)
script.Sound.SoundId = "rbxassetid://"..id
wait(10)
end
It doesn't do anything and I have no errors. What did I do wrong?
Your problem is on line 5 of that code.
The value of id is either 1, 2, 3, or 4. These correspond to the four ids you have in the music table, but you have to actually access the table to get them. :P
script.Sound.SoundId = "rbxassetid://" .. music[id]
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Oh.. lol
Hmm, still doesn't seem to work.
Oh, because I didn't play it. XD