Hello, I’m trying to make a slider that you can drag left and right, and it will scale player size to be larger and smaller, but this is not working probably?
UserinputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
if FOVDragging == true then
local mouseLocation = UserinputService:GetMouseLocation()
local relativePosition = mouseLocation - FOVSlider.AbsolutePosition
local percentage = math.clamp(relativePosition.X/sliderFrame.AbsoluteSize.X,0,1)
sliderButton.Position = UDim2.new(percentage,0,.5,0)
local maxScaleSize = 64
local minScaleSize = 8
local scale = minScaleSize + (percentage * (maxScaleSize - minScaleSize))
if character then
character.HumanoidRootPart.Size = Vector3.new(scale, scale, scale)
end
FOVDisplay.Text = tostring(math.round(scale))
end
end
end)
UserinputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
if FOVDragging == true then
local mouseLocation = UserinputService:GetMouseLocation()
local relativePosition = mouseLocation - FOVSlider.AbsolutePosition
local percentage = math.clamp(relativePosition.X/sliderFrame.AbsoluteSize.X,0,1)
sliderButton.Position = UDim2.new(percentage,0,.5,0)
local maxScaleSize = 64
local minScaleSize = 8
local scale = minScaleSize + (percentage * (maxScaleSize - minScaleSize))
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
for i,v in pairs(humanoid:GetChildren()) do
if (string.find(v.Name, "Scale")) then
v.Value = scale
end
end
end
end
FOVDisplay.Text = tostring(math.round(scale))
end
end
end)