Derma "Entity():GetModel()" Problem (DModelPanel)

how to fix?!

ClientSide:



cl_inv = {}

	net.Receive("Inventory", function(l)
		cl_inv = net.ReadTable()
		--DEBUG
		print("INV_RECEIVED")
	end)


	local Scroll = vgui.Create("DScrollPanel", DPanel) //Create the Scroll panel
	Scroll:SetSize(DPanel:GetWide() / 2, DPanel:GetTall() - DInfo:GetTall() - DermaButton:GetTall())
	Scroll:SetPos(DPanel:GetWide() / 2, DInfo:GetTall())

	local List	= vgui.Create("DIconLayout", Scroll)
	List:SetSize(DPanel:GetWide() / 2, 200)
	List:SetPos(0, 5)
	List:SetSpaceY(5) //Sets the space in between the panels on the X Axis by 5
	List:SetSpaceX(5)

	for k,v in pairs(cl_inv) do
		local ListItem = List:Add("DPanel")
		ListItem:SetSize(DPanel:GetTall() * 0.08, DPanel:GetTall() * 0.08)
		local icon = vgui.Create("DModelPanel", ListItem)
		icon:SetSize(ListItem:GetTall(), ListItem:GetTall())
		icon:SetModel(v:GetModel())
		icon.OnMousePressed = function(self)
			local list = vgui.Create("MList")
			list:AddItem(v)
			list:AddItem("d"..v, function() LocalPlayer():ConCommand("say drop") end)
			list:AddItem("e"..v, function() LocalPlayer():ConCommand("say use "..v.."") end)
		end
	end


ServerSide:



	util.AddNetworkString("Inventory")

	concommand.Add("add_item", function(ply)
		ply:GiveItem("fas2_att_sg55x30mag")
		ply:UpdateInventory()
	end)

	local meta = FindMetaTable("Player")

	function meta:UpdateInventory()
		net.Start("Inventory")
			net.WriteTable(self.Inventory)
		net.Send(self)
	end


ERROR:

[ERROR] addons/scc/lua/scc/client/scc_menu.lua:199: attempt to index a string value with bad key (‘GetModel’ is not part of the string library)

  1. error - [C]:-1
  2. __index - lua/includes/extensions/string.lua:297
    3. scc_menu - addons/scc/lua/scc/client/scc_menu.lua:199
    4. func - addons/scc/lua/scc/client/scc_menu.lua:140
    5. unknown - lua/includes/extensions/net.lua:32

If I’m to assume correctly, in your table ‘cl_inv’, the contents aren’t entities, they’re strings.
if, for example, v = “item_xyz”, then v:GetModel() won’t work, as ‘v’ doesn’t have a GetModel() metafunc.

Easier way to do this would be to write the item’s model in the table that you’re sending to the client.

THANKS!!!