How Do I Make Vertical Sliding Bar

Hey Guys So I want to make a vertical sliding gui but in this case roblox messed it up,
Jepretan Layar 2022-01-21 pukul 19.19.38

So the starting point of mouse cursor is on top left corner ( 0x, 0y )

So The Sliding Gui Got Messed Up Too

So The Slider Is Inverted :expressionless:

In slider gui, when tweening the size, change the positive to negative or negative to positive, so you can fix it.

yes but let me try and let you look at it

It Start From The Negative Line

Can you please send your code?

local inn = false
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local max = script.Parent
local ap =, max.AbsolutePosition.Y)
local as =, max.AbsoluteSize.Y)
local bar = script.Parent.Frame
local uis = game:GetService("UserInputService")

	inn = true
uis.InputEnded:Connect(function(input, gp)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		inn = false

	if inn then
		if mouse.Y < ap.Y then
			bar.Position =, 0, 0, 0)
		elseif mouse.Y > (ap.Y + as.Y) then
			bar.Position =, 0, 0, as.Y)
		else --within bounds
			bar.Position =, 0, 0, math.floor((math.floor(mouse.Y) - ap.Y)))

Jepretan Layar 2022-01-21 pukul 20.21.57

local Max = 200
local Min = -200
local Currentvalue = 0
local Holding = false
local mouse = game.Players.LocalPlayer:GetMouse()
local back = script.Parent.Parent
local moveframe = script.Parent
local APY = back.AbsolutePosition.Y
local ASY = back.AbsoluteSize.Y

		Holding = true
	Holding = false

while wait() do
	if Holding == true then
		local MY = mouse.Y
		local Pos = math.clamp(MY-APY,0,back.AbsoluteSize.Y)
		moveframe.Position =,0,0,Pos)
		Currentvalue = math.round(math.clamp(Max + (Min - Max)*(Pos/ASY), Min, Max))

new code
make sure backframe is a text button or just a button and moveframe is well a frame

hmmm, can you show the directory of the frame,button etc ?

the directory is ur frame and button

just make a button and in the button add a frame and in the frame add a local script and paste the code in the local script and you will be done!

1 Like

This can handle it all for you: SliderService - Create easy and functional Sliders!

bar.Position =, 0, 0, (ap.Y + as.Y) - mouse.Y) 

All you needed to do was get the frame’s absolute starting position on the y-axis and add to it the frame’s absolute size along the y-axis, this calculated value should represent the y-axis at which corresponds with the bottom of the frame, from there all you need to do is subtract the y-axis co-ordinate of the mouse cursor’s current position.

1 Like