1. You could use
DNumSlider:OnValueChanged to change the value of the slider by this amount (using
Panel:GetValue + amount_you_want)
2. You could use a
DTextEntry to get a value, then set the slider's value to that of the DTextEntry.
Examples:
-- For altering the increment
local frame = vgui.Create( "DFrame" )
frame:SetSize( 500, 200 )
frame:Center()
frame:MakePopup()
local slider = vgui.Create( "DNumSlider", frame )
slider:SetPos( 50, 50 )
slider:SetSize( 300, 100 )
slider:SetText( "Some text" )
slider:SetMin( 0 )
slider:SetMax( 1000 )
slider:SetDecimals( 0 )
slider:OnValueChanged( slider:SetValue( slider:GetValue() + 5 ) ) -- Increments by 5
-- For using text to change value
local frame = vgui.Create( "DFrame" )
frame:SetSize( 500, 200 )
frame:Center()
frame:MakePopup()
local slider = vgui.Create( "DNumSlider", frame )
slider:SetPos( 50, 50 )
slider:SetSize( 300, 100 )
slider:SetText( "Some text" )
slider:SetMin( 0 )
slider:SetMax( 256 )
slider:SetDecimals( 2 ) -- Allows 2 points after decimal (1 = 1.00)
local text = vgui.Create( "DTextEntry", frame )
text:SetPos( 75, 50 )
text:SetSize( 50, 50 )
text:OnValueChange( slider:SetValue( text:GetValue() ) )
Keep in mind that is rough code, I just wrote it up in like a minute or two. Keep in mind it may or may not work, but you should use this as a basis of what you want it to do.