1. Post #1

    May 2009
    43 Posts
    Hello, Recently I began using a script that allows me to select entire directory's for the players to download when they connect to my server. The problem is even though they already have the files after joining once, they server keeps making them re-download them every time they connect/map change/restart.

    Heres the script I am using:
    Code:
    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("addons/content")

    Thankyou!

  2. Post #2
    Gold Member
    Cyberuben's Avatar
    April 2009
    2,252 Posts
    http://facepunch.com/showthread.php?...1#post37149363
    Please try to search before you post. I just helped someone a week ago, exact same problem.
    Google for "site:facepunch.com <your search string>" and you'll find everything you need.