local x=false local B=.1 local t=0 function snap(x,B)if B==0 then return x else return math.floor(x/B+.5)*B end end UIS.InputEnded:connect(function(B,t)if B.UserInputType==Enum.UserInputType.MouseButton1 then x=false end end)SliderBtn.MouseButton1Down:connect(function()x=true end)RuS.RenderStepped:connect(function(W)if x then local x=(UIS:GetMouseLocation()).X local W=SliderBtn.Position local w=Slider.AbsoluteSize.X local R=Slider.AbsolutePosition.X local l=snap((x-R)/w,B)t=math.clamp(l,0,1)SliderBtn.Position=UDim2.new(t,0,W.Y.Scale,W.Y.Offset)local K=t wait()if K~=t then game.Players.LocalPlayer.Character["\086\105\098\101 \082\097\100\105\111"].changevolume:FireServer(t)end end end)

local held = false
local step = 0.1
local percentage = 0

function snap(number, factor)
	if factor == 0 then
		return number
	else
		return math.floor(number/factor+0.5)*factor
	end
end

UIS.InputEnded:connect(function(input, processed)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		held = false
	end
end)

SliderBtn.MouseButton1Down:connect(function()
	held = true
end)

RuS.RenderStepped:connect(function(delta)
	if held then
		local MousePos = UIS:GetMouseLocation().X
		local BtnPos = SliderBtn.Position
		local SliderSize = Slider.AbsoluteSize.X
		local SliderPos = Slider.AbsolutePosition.X
		local pos = snap((MousePos-SliderPos)/SliderSize,step)
		percentage = math.clamp(pos,0,1)
		SliderBtn.Position = UDim2.new(percentage,0,BtnPos.Y.Scale, BtnPos.Y.Offset)
		local old = percentage
		wait()
		if old ~= percentage then
			game.Players.LocalPlayer.Character["Vibe Radio"].changevolume:FireServer(percentage)
		end
	end
end)
