Include and download File Directory?

I was wondering, since I’m likely going to be using the kermite weapon pack for weapons in my gamemode then CSS weapons, considering that there are more weapons and that way people won’t have to buy counterstrike, I was wondering if there was someway to rather then just do it by individual files, download and include files in a lua file so that way I don’t have to write a million lines of code just to include kermite weapons and such.

If you mean let clients download CSS content from your server, thats iligal
Other then that, use custom models :smiley:

bromvlieg I don’t know how you got that out of what he said but hes looking to add kermites weapons to the download list I believe, anyway here.


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.."/*")) do
		resource.AddFile(dir.."/"..v)
	end
end
 
AddDir("models/yourmodels")

credit to the wiki for the code to feed the post count spam below me.

Lol, give credit for things you rip from the wiki. :slight_smile:

I never said I made the code