DMultiChoice with nil value

When I call the function that makes the HUD, I recieve this message:
Attempt to call to index local: ‘CompraArmas’
My code:



function Shop(ply)
	if ply:Alive() then
		Menu = vgui.Create("DFrame")
		Menu:SetSize(ScrW() * 0.5 , 20)
		Menu:Center()
		Menu:SetTitle('[Clã | BR] Shop')
		Menu:SetSizable(true)
		Menu:SetVisible(true)
		Menu:MakePopup()
		
		LabelArmas = vgui.Create("DLabel", Menu)
		LabelArmas:SetSize(ScrW() * 0.227, 23)
		LabelArmas:SetPos(20, 50)
		LabelArmas:SetText("Escolha sua arma:")
		
		local ComboArmas = vgui.Create("DMultiChoice", Menu)
		ComboArmas:SetPos(5,28)
		ComboArmas:SetSize( 100, 20 )
		ComboArmas:AddChoice("SMG1")
		ComboArmas:AddChoice("AR2")
		ComboArmas:AddChoice("Magnum .357")
		
	end
end


ComboArmas != CompraArmas

You misspelled it

What you should be using is DComboBox:
[lua]function Shop(ply)
if ply:Alive() then
Menu = vgui.Create(“DFrame”)
Menu:SetSize(ScrW() * 0.5 , 20)
Menu:Center()
Menu:SetTitle(’[Clã | BR] Shop’)
Menu:SetSizable(true)
Menu:SetVisible(true)
Menu:MakePopup()

	LabelArmas = vgui.Create("DLabel", Menu)
	LabelArmas:SetSize(ScrW() * 0.227, 23)
	LabelArmas:SetPos(20, 50)
	LabelArmas:SetText("Escolha sua arma:")
	
	local ComboArmas = vgui.Create("DComboBox", Menu)
	ComboArmas:SetPos(5,28)
	ComboArmas:SetSize( 100, 20 )
	ComboArmas:AddChoice("SMG1")
	ComboArmas:AddChoice("AR2")
	ComboArmas:AddChoice("Magnum .357")
	
end

end[/lua]