function WeaponVguiMenu() local classtable = Primaries local frame = vgui.Create("Frame") frame:SetSize(400,600) frame:SetPos(ScrW()/2-200,ScrH()/2-300) --Centre the frame frame:PostMessage("setTitle", "text", "Selection Menu") frame:SetVisible(true) frame:MakePopup() //frame:SetZPos(1) local xpos = ScrW()/2-180 local ypos = ScrH()/2-270 local ytotal = 50 --Was 60 before for k, v in pairs(classtable) do local button = vgui.Create("Button",frame) //button:SetParent(frame) button:SetText(classtable[k].Name) button:SetPos(xpos,ypos) //button:SetVisible(true) //button:MakePopup() //button:SetZPos(6) button.DoClick = function( ) UpdatePrimary(classtable[k].Weapon) EquipVguiMenu() frame:Remove() end; local label = vgui.Create("Label",frame) label:SetText(classtable[k].Desc) label:SetPos(xpos+70,ypos) label:SetSize(300,30) //label:SetParent(frame) //label:SetVisible(true) //label:MakePopup() //label:SetZPos(7) ypos = ypos + 30 ytotal = ytotal + 30 end frame:SetSize(400,ytotal) //frame:SizeToContents() end