Im trying to create a derma menu where the Mayor can set the legality of certain weapons, and it would notify the players and they would open another menu where they can see the gun laws, I’m having problems with the DMultiChoice and the DComboBox, basically when the mayor clicks on the gun in the DComboBox, they go and selec either “Legal” or “Illegal” in the DMultiCHoice, I’m wondering how that would work, also how would I add a chat command?
[lua] local GunFrame = vgui.Create(‘DFrame’)
Local GunComboBox = vgui.Create(‘DComboBox’ Dframe)
GunComboBox.OnMousePressed = function() end
GunMultiChoice = vgui.Create(‘DMultiChoice’ Dframe)
GunMultiChoice.OnMousePressed = function() end
function GunMultiChoice:OnSelect(Index, Value, Data) end
print("Option " … value … " has been picked at the index " … index )
– Here you must put all your derma controls.
end) – Adds hook, so when we starting a new game or connecting to a server our menu creates.
concommand.Add(“rb655_frame_open”,function() GunFrame:SetVisible(true) end) – Create console command to open your panel.
concommand.Add(“rb655_frame_close”,function() GunFrame:SetVisible(false) end) – Create console command to close your panel. [/lua]