local list = script.Parent.songlist:GetChildren() while wait(0) do local randomaudio = math.random(1, #list) randomaudio:Play() wait(randomaudio.TimeLenght) end
Workspace.Radio.sound.RANDOM:5: attempt to index local 'randomaudio' (a number value)
If you read this, you are epic.
Please fix my little problem, thanks!
You have the right idea, you almost have it!
You've given the numbers for math.random but have not defined where to get the audios from.
local tableOfSounds = {sound1, sound2, sound3} local randomSound = tableOfSounds[math.random(1, #tableOfSounds)] -- What we are doing here is taking out a sound from the table, using math.random to pick from that table. randomSound:Play()