Model table

Hello Facepunch, I wanted to ask if theres somehow an table, containing all models on the server(maybe if possible including the addon models too), where I can run an for loop on, if yes, how do I access it/What is its variable?
Edit: I found

player_manager.AllValidModels but does it only store “default” models, or also addon ones?

Recursively loop through the models folder?

Well, I actually did already what I wanted with a bit of testing, just wanted to close the thread but you replied, I was too lazy to write pointshop models myself, and therefore made an small script that loops through the “global” table of valid models - still dont know if it includes addons yet; and made it write text files in the data folder with each model name:



if not file.Exists("modelthing", "DATA") then
	file.CreateDir("modelthing")
end
for _, v in pairs(player_manager.AllValidModels()) do
	local path = player_manager.TranslatePlayerModel(v)
	local content = [[
ITEM.Name = '%s'
ITEM.Price = 10000
ITEM.Model = '%s'

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

function ITEM:PlayerSetModel(ply)
	ply:SetModel(self.Model)
end]]
	content = string.format(content, player_manager.TranslateToPlayerModelName(v), v)
	print(content)
	file.Write("modelthing/"..player_manager.TranslateToPlayerModelName(v)..".txt", content)
end


At the end, this is the result:

Now I gotta rename them all to .lua :v:
-Closed