So I'm trying to make a random music player, and trying to make it more efficient by it getting the exact length of the song and shortening it by 5-10 seconds for a fade out. I've made this successfully working in studio however it never seems to work in server.
local sound = Instance.new("Sound", workspace)
sound.Name = hash
sound.SoundId = "http://www.roblox.com/asset/?id="..current
sound.Volume = 0
sound:Play()
while wait() do --I was encontering this issue so I added a loop to check if its loaded
if sound.TimeLength > 0 then
length = sound.TimeLength --"length" is just a variable I made so I can cut 5 seconds off later
break
end
end
for fade = 1, 100 do
sound.Volume = sound.Volume +0.01
wait()
end
Are we just not allowed to access TimeLength? Or is there a problem with this script?

2 comments
that only works on localsounds
Does this mean you can create sounds from a local script for this to work?