Hello guys. I tried to override a function on ListBox, but is not working
[CODE]
ListArmas.DoClick = function()
chat.AddText( Color( 0, 255, 0 ), "[Clã | BR]", nickteamcolour3, name3, Color( 255, 255, 255 ), " Selecione algo antes de comprar" )
if string.match(selecao, "Armas de fogo") != nil then
for k, v in pairs(WeaponsTable) do
SetLabelText(v.WeaponName, selecao)
end
elseif string.match(selecao, "Armas de explosão") != nil then
for k, v in pairs(ExplosionTable) do
SetLabelText(v.WeaponName, selecao)
end
else
for k, v in pairs(MeleeTable) do
SetLabelText(v.WeaponName, selecao)
end
end
end
[/CODE]
How can I do to change a Label when I selected an Item on my Listbox?
LabelName:SetText not SetLabelText. IDK if this is wrong because all I use that more often than anything else.
[QUOTE=LUModder;46462200]LabelName:SetText not SetLabelText. IDK if this is wrong because all I use that more often than anything else.[/QUOTE]
SetLabelText is a function that I created. What I wanna know is how can I "hook" the doClick function on a list box, than get the selected Item
ListBox.DoClick = function()
[QUOTE=Exho;46471215]ListBox.DoClick = function()[/QUOTE] in my code I did this, but didn't hook the event
You have ListArmas.DoClick = function(), does that match to the vgui element you're clicking?
[QUOTE=mib999;46482420]You have ListArmas.DoClick = function(), does that match to the vgui element you're clicking?[/QUOTE]
Yes, I created a ListBox, add items in there, then hook the DoClick function, but when I try to select an Item on ListBox, nothing happens
Sorry, you need to Log In to post a reply to this thread.