When I call the function that makes the HUD, I recieve this message:
Attempt to call to index local: 'CompraArmas'
My code:
[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
[/CODE]
ComboArmas != CompraArmas
You misspelled it
What you [i]should[/i] be using is [b]DComboBox[/b]:
[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]
Sorry, you need to Log In to post a reply to this thread.