SliderService - Create easy and functional Sliders!

I’ve been sick the past 3 days so I haven’t made any progress on this module unfortunately.

Is there anyway to change the “End” constructor?

Would you mind explaining what you mean? I’m not sure I understand

I have a speed adjuster but your max speed scales with level, would i need to make a whole new slider or could i edit the “end”

You’d have to recreate the slider, I might consider adding functionality for this in the next update

@Krystaltinan do you think you could add support for 2 sliders? for max and min values
image
image

Not sure yet, as the current system I have was designed for one slider only, I’ll see what I can do after I fix this really annoying surfacegui bug

2 Likes

you could fix it faster with my new plugin wink wink

Xbox Controller support.
You Hold a button down and press left or right dpad to move it 1 icrement
you should also be able to set what button you hold down.

4 Likes

Slider Update
Version 2.1.0

:x: Removed :x:

Unfortunately, after hours of attempts, I’ve decided to give up on SurfaceGui support for this module. I know this isnt the result or what people were hoping for, however the amount of edge cases I need to account for is just too high and it seems impractical to try and fix all the bugs my code has.

:notebook: Additions :notebook:

Thanks to @Alvin_Blox , you can now disallow the Background clicking of the slider, by adding a key in the configuration table called AllowBackgroundClick and setting it to false, the slider will now not create a background button! If you’re confused about this just check the API for Slider.new()!

1 Like

Slider Update
Version 2.1.1

:x: Removed :x:

This update removes the usage of the Switch module as it overcomplicates and bloats the script!

:notebook_with_decorative_cover: Fixed :notebook_with_decorative_cover:

Thank you to @rivetbomber who has helped me fix the nil parenting bug! If you parent the holder frame of your slider to nil or another place, it won’t cause the slider button to disappear and break.

Why it happened

The basic principle for this bug was basically when I calculated the new position of the slider, the AbsoluteSize of the holder and button were both 0. This then resulted in a calculation which caused the slider buttons position to be 0/0.

The reason this caused breakages was because you cant actually tween the slider button if its position isn’t even a number in the first place, meaning I had to also tweak some internal code to be able to update the sliders position when not only the absolutesize changes, but when the player controls the slider aswell.

Another bug fixed (with thanks to @rivetbomber) is that :GetIncrement() and :OverrideIncrement() now work! I removed a crucial line of code which kinda broke it, whoops!

That’s all in the latest version! The model has been updated accordingly.

3 Likes

Wanted to personally thank you for this resource :smiley:. It saves me a ton of time and is wonderfully done.

All good! Hope its useful for you!

3 Likes

For some reason my usage of the module isn’t working despite following the example.

These are all the usages of the module in my script

local slideconfig = 
	{
		SliderData = {Start=0,End=10,Increment=.1},
		MoveInfo = TweenInfo.new(.1,Enum.EasingStyle.Linear), 
		Axis = 'X'
	}
local buyslide = slider.new(buyboard,slideconfig)
buyslide.Changed:Connect(function(prc)
	local buyamount = math.floor(bal.Value / price.Value*(prc/10))
	buycol.Size = UDim2.new((prc/10),0,1,0)
	buylab.Text = simplify(buyamount * price.Value)
end)
buyslide:OverrideIncrement(1/buys)

My bad, I’ve misread and forgot to actually track the slider :man_facepalming:

1 Like

Super easy to understand, Great job! :raised_hands:

1 Like

Is there any way to make the slider start from the other way around?
Like for me i am making a slider on Y axis where i wan the start to be at the bottom. But by default the 0 value goes to top and 100 to the bottom.

For now i’m using it like DefaultValue=100 and actual = 100-val

Would love if there is a straightforward way to do this.

Thanks for this amazing tool btw :smile:

What if you tried taking a normal slider and flipped it 180°?

Do you ever plan on adding toggle sliders?

toggles aren’t hard to make so i’m not sure why it would be added