SliderService - Create easy and functional Sliders!

I think you should rename this module to “SliderService” since it will generate more attention and the name is much shorter. Plus, it’s easy to remember

Hey, I’ve been wondering if you fixed the bug or not, me and my friend really needs it.
Thanks.

I stated above that it’s been fixed :smiley:

1 Like

Hey, I’ve ran into another problem sadly.
(Really sorry if I’m using it wrong)
I can’t scroll anywhere (Coded the duration one not type, I can’t scroll the duration one…)

Script

	local SliderHolder = InspectCutscenePartFrame.PartSettingsFrame.DurationSettingsFrame.SliderFrameHolder


		local FOVSlider = Slider.new(SliderHolder, {
			SliderData = {Start = 1, End = 50, Increment = 1},
			MoveInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad)
		})
		FOVSlider.Changed:Connect(function()
			print("Changed..")
		end)
		
		FOVSlider:Track()

The padding doesnt seem to work when i try it.
I have made the padding a number that would be noticeable.

You have to track it before you do the .Changed:

local SliderHolder = InspectCutscenePartFrame.PartSettingsFrame.DurationSettingsFrame.SliderFrameHolder


		local FOVSlider = Slider.new(SliderHolder, {
			SliderData = {Start = 1, End = 50, Increment = 1},
			MoveInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad)
		})
        FOVSlider:Track()

		FOVSlider.Changed:Connect(function()
			print("Changed..")
		end)
2 Likes

Oof :cry: I already changed the system to TextBox, Welp Thanks for helping I guess.
Also, I don’t think that’s the Problem the Template game he has track below.

1 Like

Will attempt to fix soon.
@Katrist iirc you’re meant to put .Changed before the Track is called

Oh, I thought it was after, sorry for the inconvenience.

2 Likes

you are meant to put the event before the call because once you set an event it will “start”, so it won’t retrieve anything before the event (that’s why it’s better to place .changed before :track)

@Krystaltinan I found a bug in which if you make a slider but the parent of the slider button is nil, it won’t work after reparenting (the position was set to nan for some reason)

It does work if I set the parent before defining the slider

There’s another weird thing that was happening to me where clicking the button wouldn’t move the slider (i believe it was also the parent issue), however, for some reason, it works now

@Krystaltinan
There’s a problem with your SurfaceGUI support and it’s at this line here:

The problem here, is that this will not work for SurfaceGUIs that aren’t parented to BaseParts. There are heaps of situations where people put SurfaceGUIs inside PlayerGUIs or something to make interactable SurfaceGUIs easier.

This is an easy fix though. All you have to do is add an extra check for the SurfaceGUI’s Adornee property.

	elseif holder:FindFirstAncestorOfClass("SurfaceGui") then
		local SurfaceGui = holder:FindFirstAncestorWhichIsA("SurfaceGui")
		
		self._data.UiType = "SurfaceGui"
		self._data.SurfaceGui =	SurfaceGui
		self._data.HolderPart = holder:FindFirstAncestorWhichIsA("BasePart") or SurfaceGui.Adornee
	end

Oh damn, completely forgot about a case like this. Will implement soon!

1 Like

Is the connections running on bindable events?

No, it’s a signal class (shown in the post)

hey there, how can I disable clicking on the slider background to jump to a specific position? you have no event which fires when this happens, and I don’t want to use changed/dragged as it will fire nearly every frame,

1 Like

Oh damn! Didn’t think of that at all haha, I’ll add support ASAP

Are you sure your slider button is a direct child of the frame? It works in my studio? How is your slider set out

@Alvin_Blox @Ethanthegrand14 There might be a slight delay on the fixes you both requested, I’m currently trying to fix a core surfacegui problem so it might take a bit.

2 Likes

When are you going to add Plugin support? Or is it already added and I’m doing something wrong…?