How would I make sound files autorun?

I got songs for the radio system in my GhettoRP im working on but How would I make it so sounds from sounds/music/ auto download so people can hear them when there played on the radio?

resource.AddFile(“path/to/my/file.extension”)


function AddDir(dir) // recursively adds everything in a directory to be downloaded by client
	local list = file.FindDir("../"..dir.."/*")
	for _, fdir in pairs(list) do
		if fdir != ".svn" then // don't spam people with useless .svn folders
			AddDir(fdir)
		end
	end
 
	for k,v in pairs(file.Find("../"..dir.."/*")) do
		resource.AddFile(dir.."/"..v)
	end
end
 
AddDir("sound/gangmusic")

That doesn’t work… The directory the music is in is garrysmod/sound/gangmusic/
but for some reason it won’t make people download the music… Can someone tell me why it wont work?

Put the sound in [gamemode name here]/content/sound/

Then do

AddDir(“sound/gangmusic”)

The music is downloaded I got a friend to test it and it makes him dl it. But for some reason when its played through the radio only I can hear it and he can’t.

Did he rejoin? Sometimes resource.addfile causes wierd bugs. Most of the time people have to rejoin to see new models or hear new sounds :expressionless: