Derma options won't affect in-game

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:

function dermaMenu()

	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)
	Slide:SetPos( 25,50)
	Slide:SetSize(150, 100)
	Slide:SetText("Max Props")

concommand.Add("DermaMenu", dermaMenu)

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.

It worked for me

Is it the actual slider not working?

Well, ya i got that exact thing thats on yur screen, but were u able to still spawn props when the slider went to zero? i was able to even tho it was at zero, meaning that the maxprops werent changed


Are you sure you are spawning props, and not ragdolls, or something?

I don’t know why it works with you (or probably everyone else) but I place the lua file in client and then run the file in console, drag it to 0, try to spawn something and it spawns. It is a prop, not a ragdoll though. Is there another thing I must do for it to work? Maybe another command or something?

I dunno - I copy & pasted your exact code into my lua/autorun/client/test.lua and it worked perfectly. If you want you can add me and I’ll help you through it.