Lua

Hello.

I am trying to get the force download.lua work and here is what mine says


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("gamemodes/gpk/content/models/weapons")
resource.AddFile("gamemodes/gpk/content/models/weapons/v_gpk_fists.mdl")
resource.AddFile("gamemodes/gpk/content/models/weapons/v_gpk_fists.sw.vtx")
resource.AddFile("gamemodes/gpk/content/models/weapons/v_gpk_fists.dx80.vtx")
resource.AddFile("gamemodes/gpk/content/models/weapons/v_gpk_fists.dx90.vtx")
resource.AddFile("gamemodes/gpk/content/models/weapons/v_gpk_fists.vvd")

And when I spawn in the parkour mod that I downloaded, instead of fists, it’s just an error. Can anyone help me?


(User was banned for this post ("Wrong forum" - Overv))

Copy the content to your main garrysmod/ folder, so for example, garrysmod/models/weapons/v_gpk_fists.mdl, and then add that. Also, adding the .mdl of a model adds all related files too, so those last four lines are unnecessary.