-- Decompiled with Visenya | https://targaryentech.com

local UIS = game:GetService("UserInputService")
wait(1)
local P = script.Parent
local slider = P.Slider
local knob = slider.Knob
local FOVLabel = P.FOVValue
local knobGrabbed = false
function GrabFOVKnob()
  knobGrabbed = true
end
function MoveFOVKnob(screenPosition)
  local yDiff = screenPosition.y - slider.AbsolutePosition.y
  local knobPositionRatio = math.min(math.max(yDiff / slider.AbsoluteSize.y, 0), 1)
  local newFOV = 100 + 9900 * (1 - knobPositionRatio)
  script.Parent.Parent.Dist.Value = newFOV
  knob.Position = UDim2.new(0, -10, knobPositionRatio, -10)
  FOVLabel.Text = math.floor(newFOV)
end
function ReleaseFOVKnob()
  knobGrabbed = false
end
knob.InputBegan:connect(function(input)
  if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
    GrabFOVKnob()
  end
end)
UIS.InputChanged:connect(function(input, gameProcessedEvent)
  if not gameProcessedEvent and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and knobGrabbed then
    MoveFOVKnob(input.Position)
  end
end)
UIS.InputEnded:connect(function(input, gameProcessedEvent)
  if not gameProcessedEvent and input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
    ReleaseFOVKnob()
  end
end)
