• problems with lua AddSingleFile - downloads to wrong path
    0 replies, posted
Hello, this baffels me, I have this script: [CODE]local models = { 'astronauthelmet', 'cakehat', 'duncehat', 'gmod_tower', 'sam', 'santa', 'vikinghelmet', 'thresh' } local materials = { 'models/astronauthelmet', 'models/cakehat', 'models/duncehat', 'models/gmod_tower', 'models/sam', 'models/santa', 'models/vikinghelmet', 'models/thresh' } -- end function resource.AddDir(dir) local f, d = file.Find(dir .. '/*', 'GAME') for k, v in pairs(f) do resource.AddSingleFile(dir .. '/' .. v) end for k, v in pairs(d) do resource.AddDir(dir .. '/' .. v) end end for _, mf in pairs(models) do resource.AddDir('models/' .. mf) end for _, mf in pairs(materials) do resource.AddDir('materials/' .. mf) end[/CODE] it should download all of the above to garrysmod/models(garrysmod/download/models) and garrysmod/materials(garrysmod/download/materials), but it downloads all the files to garrysmod\download\addons\accessoriespack and even fails to download to garrysmod\download\addons\playermodels? Here is the full addon(simply pointshop with a few modifications) as a zip: [url]http://speedy.sh/AEtZ7/pointshop.zip[/url] Normally I don't have problems with simple lua, but in this case I simply can't figure it out, it should work - everything. [editline]6th August 2014[/editline] any help? the problem is the script above, see zip file for the addon, help would be very useful, Thank you.
Sorry, you need to Log In to post a reply to this thread.