New Script
New Script
New Script
local originalColors = {}
sliderFrame.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or
input.UserInputType == Enum.UserInputType.Touch then
dragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or
input.UserInputType == Enum.UserInputType.Touch) then
local position
if input.UserInputType == Enum.UserInputType.MouseMovement then
-- Calculate position for mouse input
position = (input.Position.X - sliderFrame.AbsolutePosition.X) /
sliderFrame.AbsoluteSize.X
else
-- Calculate position for touch input
position = (input.Position.X - sliderFrame.AbsolutePosition.X) /
sliderFrame.AbsoluteSize.X
end
-- Call the callback with the new slider position (scaled to 0-255)
callbackFunction(math.floor(pos * maxColorValue))
end
end)
end