So, I made a file called downloads.lua and placed it in lua/autorun/server. It didn't work. Here is the file:
Code: Select all
local path = "../"..GM.Folder.."/models"
local folders = {""}
while true do
local curdir = table.remove(folders,1)
if not curdir then break end
local searchdir = path..curdir
for _, filename in ipairs(file.Find(searchdir.."/*")) do
if filename ~= ".svn" then
if file.IsDir(searchdir.."/"..filename) then
table.insert(folders,curdir.."/"..filename)
else
resource.AddSingleFile(string.sub(curdir.."/"..filename,2))
end
end
end
end