local songsIds = {445943699, 201680547, 910813585, 154870011, 226294028}
while true do wait()
x = math.random(#1,songsIds)
y = songsIds[x]
local Song = Instance.new("Sound",game.Workspace)
Song.SoundId = "http://roblox.com/asset?id="..y
Song.Volume = 10
Song.PlaybakcSpeed = 1
Song.Looped = false
Song.MaxDistance = 99999
Song:Play()
debris:AddItem(Song,Song.TimeLength)
wait(Song.TimeLength - 3)
for fade = 1,10,0.1 do wait(0.1)
Song.Volume = Song.Volume - 0.01
end end
It throws the error...
-- Workspace.SoundPlayer.Script:11: attempt to get length of a number value
I've tried changing the table to just a pile of strings like
local songsIds = "445943699","201680547","910813585","154870011","226294028"
I tried
x = (tostring(math.random(#1,songsIds)))
and I've tried
x = (tonumber(math.random(#1,songsIds)))
Throws the same exact error each time.

1 comment
The code you added doesn't work - specifically, the songsIds for loop.