Perlin Noise & FBM biome transition

Sup, i am trying to make a generator with smooth biome transitions. I tried doing a biome transition from monutains to a valley, where the blobs in the perlin noise smooth out, however it ended up creating a massive cliff at the border with the mountains
What do i need to change in this code in order to make valleys more smooth while keeping the mountains tall and steep?
The parameters that I use are: chunks - 3, size - 200, block_size - 1, amplitude - 200, gain - 0.4, lacunarity - 2, scale - 200, octaves - 5, part height - 3, seed - 15
I just thought of making like a heightmap of the perlin noise and where the height is low the blobs would become flatter and more smooth, but I dont know how to do this either

Theres the code

local function GenerateMap(chunks,size, block_size, ampltiude_fbm, gain, lacunarity, scale, octaves, xOffset, zOffset, height,seed)
	local StarterTable = {ampltiude_fbm,gain,lacunarity,scale,octaves}
	local actualX = 0
	local actualZ = 0
	for i=1,chunks do
		if i > 1 then
			actualX += size
		end
		for i=1, chunks do
			if i > 1 then
				actualZ += size
			end
			for x=0, size do
				task.wait()
				for z=0, size do
					x += actualX
					z += actualZ
					local amplitude = 1
					local frequency = 1
					local total = 0
					local normalizer = 0
					local noise
					--------
					for octave=1, octaves do
						noise = math.noise(((x + xOffset) / scale) * frequency, ((z + zOffset)  / scale) * frequency,seed)
						noise = math.clamp(noise, -1, 1)
						total += noise * amplitude
						amplitude *= gain
						frequency *= lacunarity
						normalizer += amplitude
					end
					total /= normalizer
					total *= ampltiude_fbm
					---------
					local block = Instance.new("Part")
					block.Parent = game.Workspace.TerrainParts
					block.Size = Vector3.new(block_size, block_size, block_size)
					block.Position = Vector3.new(x * block_size, math.floor(total + 10) * block_size, z * block_size)
					
					block.Size = Vector3.new(block_size,block_size * height,block_size)
					block.Position -= Vector3.new(0,block.Size.Y / 2,0)
					
					if block.Position.Y >= 20 * block_size then
						block.Material = Enum.Material.Slate
					else
						block.Material = Enum.Material.Grass
					end

					block.Anchored = true

					x -= actualX
					z -= actualZ 
				end
			end
		end
		actualZ = 0
	end
end```