Adding Player Models

So, I am trying to get player models added into the Pointshop addon. Which getting them into the POINTSHOP is done and easy. However, the materials aren’t loading properly, I am guessing. Because, when I use that player model, I have the right outline/shape of the playermodel but I am just a pink checkerboard. I’ve installed the materials to ‘garrysmod/materials/models/<insert material name here>’ and installed the models to ‘garrysmod/models/player’. This is what my lua file looks like when adding resources to be downloaded:


if (SERVER) then
	resource.AddFile( "models/f_all.mdl" )
	resource.AddFile( "models/m_all.mdl" )
	resource.AddFile( "models/player/tf2/sniper_blue.mdl" )
	resource.AddFile( "models/player/tf2/sniper_red.mdl" )
	resource.AddFile( "models/player/tf2/spy_blue.mdl" )
	resource.AddFile( "models/player/tf2/spy_red.mdl" )
	resource.AddFile( "materials/models/player/techknow/tf2/spy/eyes.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/spy/eyes.vtf" )
	resource.AddFile( "materials/models/player/techknow/tf2/spy/spy_blue.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/spy/spy_head_blue.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/spy/spy_head_red.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/spy/spy_red.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/sniper/eyes.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/sniper/eyes.vtf" )
	resource.AddFile( "materials/models/player/techknow/tf2/sniper/sniper_blue.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/sniper/sniper_head.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/sniper/sniper_lens.vmt" )
	resource.AddFile( "materials/models/player/techknow/tf2/sniper/sniper_red.vmt" )
end

And then this is what my lua file looks like for the Pointshop


ITEM.Name = 'Blue Spy'
ITEM.Price = 1000
ITEM.Model = 'models/player/tf2/spy_blue.mdl'

function ITEM:OnEquip(ply, modifications)
	if not ply._OldModel then
		ply._OldModel = ply:GetModel()
	end
	
	timer.Simple(1, function() ply:SetModel(self.Model) end)
end

function ITEM:OnHolster(ply)
	if ply._OldModel then
		ply:SetModel(ply._OldModel)
	end
end




Not sure what is going wrong here, if someone can help it’d be appreciated.

I suggest you test that the materials are actually accessible; try setting it as a material for a random prop, and see if it works. You can do this in Lua, or by setting the convar material_override to your material and using the material tool on a prop.

Alright, if it works, what should I do? and if it fails, what should I do?

If it works, the problem may lie in material references within the model. If not, the material files are probably not getting to clients. If it is a problem with your model, try checking that the directory specified in $cdmaterials in the model’s QC file matches the location of the material files.