Downloading Files



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(dir.."/"..fdir)
		end
	end
 
	for k,v in pairs(file.Find(dir.."/*", true)) do
		resource.AddFile(dir.."/"..v)
	end
end
 
AddDir("models")
AddDir("materials")


AddDir(“models”)
AddDir(“materials”)

wil this work?

Can you guys pleas help me i think its really easy

Use this:

[lua]function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client
local list = file.FindDir(dir…"/*", true)
for _, fdir in pairs(list) do
if fdir != “.svn” then // Don’t spam people with useless .svn folders
AddDir(dir…"/"…fdir)
end
end

for k,v in pairs(file.Find(dir.."/*", true)) do
	resource.AddFile(dir.."/"..v)
end

end

AddDir(“models”)
AddDir(“materials”)
[/lua]