# Sliders

To create a slider, use this.

```lua
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
})
```

{% hint style="warning" %}
If you are having issues, you're supposed to replace "Tabs.Main" with your actual tab.&#x20;

Example: "Tabs.Exploits"&#x20;

Whatever you put in your [tabs](https://idontgiveaf.gitbook.io/fluent/components/window/tabs "mention") variable, it's what you need.
{% endhint %}

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)

```lua
Slider.Value
```

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

```lua
Options.Slider.Value
```

### Functions

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

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

To set the value of a slider, use this.

```lua
Slider:SetValue(3)
```

{% hint style="warning" %}
If you don't set the right variable name, it won't work.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://idontgiveaf.gitbook.io/fluent/elements/guide/sliders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
