I’m trying to make a model panel that sets your model. problem is that when it sets it, it only shows up different in the DModelPanel I made. I’ve asked people what my model looks like and they say it looks the same. any solutions?
Code:
[lua]concommand.Add(“model_menu”,function(ply)
local modelframe = vgui.Create(“DFrame”)
modelframe:Center()
modelframe:SetSize(220,200)
modelframe:SetTitle("Models")
modelframe:MakePopup()
local IconList = vgui.Create( "DPanelList", modelframe )
IconList:EnableVerticalScrollbar( true )
IconList:EnableHorizontal( true )
IconList:SetPadding( 4 )
IconList:SetPos(10,30)
IconList:SetSize(200, 160)
for k,v in pairs(Models) do
local icon = vgui.Create( "SpawnIcon", IconList )
icon:SetModel( v )
icon:SetToolTip( v )
IconList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" )
ply:SetModel(v) end
end
end)[/lua]