Sliders

I might fix how slider's hitbox is so small.

To create a slider, use this.

local Slider = Tabs.Main:AddSlider("Slider", 
{
    Title = "Slider",
    Description = "This is a slider",
    Default = 2,
    Min = 0,
    Max = 5,
    Rounding = 1,
    Callback = function(Value)
        print("Slider was changed:", Value)
    end
})

Change local Slider to a different variable name every time. It can be anything.

Slider (name of slider) is saved in the Options variable.

You can try to remove it, but I've never tried to.

You can get the value anywhere simply by using this: (Put your variable name)

Slider.Value

Or, whatever you put as the name of the toggle.

Options.Slider.Value

Functions

You can check when the slider is changed, but Callback does the same thing.

Slider:OnChanged(function(Value)
    print("Slider changed:", Value)
end)

To set the value of a slider, use this.

Slider:SetValue(3)

Last updated