You need to use the Size of the bar as a point to help get the size it should be
Try this and se if it helps
local current = 1
local maxVal = 5
local xSize = Bar.Size.X.Scale --Just so we have the original size
button.MouseButton1Click:Connect(function()
local useSize = (current/maxVal) * xSize --A formula that is useful for this
Bar.Size = UDim2.new(useSize, 0, 1, 0)
end)