Hey guys. So you might've already seen my thread regarding how to make a GUI slider. (Like a setting for volume, or etc.) with a min and max position constraint.
I finally got it working.
BUT
I just noticed, depending on how big the window is, aka, if it's minimized or maximized, the slider bars won't slide correctly. I think it's because I used offset to position the slider from the original X position with the MouseMoved event.. :/
Any help would be great. Thanks!
local valueTxt,maxTxt,max,theValue = slider.Parent.Value,slider.Parent.Max,slider.Parent.MaxValue,slider.Parent.CurrentValue
slider.Parent.MouseMoved:connect(function(x,y)
if down then
local final = y - 240
local value = (final > 108 and 108 or false) or (final < 0 and 0 or final)
slider.Position = UDim2.new(0,0,0,value)
local number = math.floor(max.Value - (max.Value * (slider.Position.Y.Offset / 108)))
valueTxt.Text = "Value: "..number
theValue.Value = number
end
end) |