So, I'm trying to make a derma menu with these options such as a button that when pressed kills you, which works, but the problems I'm having are with the ConVars, such as sbox_maxprops or sbox_godmode. here is my code:
It's made so that a menu pops up when you type Derma into the console. In the menu is a slider that (suppose to) affect the number of max props. I slide it to 0, but I'm still able to spawn props. That's where the problem is. Any advice helps.
local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
DermaPanel:SetPos( 50,50 ) -- Position on the players screen
DermaPanel:SetSize( 200, 250 ) -- Size of the frame
DermaPanel:SetTitle( "Testing Derma Stuff" ) -- Title of the frame
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true ) -- Draggable by mouse?
DermaPanel:ShowCloseButton( true ) -- Show the close button?
DermaPanel:MakePopup() -- Show the frame
local Slide = vgui.Create("DNumSlider", DermaPanel)