You need to figure out the math involved to place the Part at 5 stud intervals in the Y axis.
It looks like your math for the X and Z axis works well, but it looks like you have the Y axis being set to a .5 stud difference instead of a 5 stud difference.
local WorldProportionX, WorldProportionY, WorldProportionZ = 100, 100, 100
local NoiseScale = 50
local Height = 5
local PartProportion = 3
math.randomseed(tick())
local MathRandom = math.random()
for Number = -WorldProportionX, WorldProportionX do
for Number2 = -WorldProportionY, WorldProportionY do
for Number3 = -WorldProportionZ, WorldProportionZ do
local MathNoise = math.noise(Number2 / NoiseScale, Number3 / NoiseScale, MathRandom) * Height
local MathNoise2 = math.noise(Number / NoiseScale, Number3 / NoiseScale, MathRandom) * Height
local MathNoise3 = math.noise(Number / NoiseScale, Number2 / NoiseScale, MathRandom) * Height
local Density = MathNoise + MathNoise2 + MathNoise3 + Number2
if Density > 10 and Density < 20 then
local Part = Instance.new("Part")
Part.Anchored = true
Part.CFrame = CFrame.new(Number * PartProportion, Number2 * PartProportion, Number3 * PartProportion)
Part.Size = Vector3.new(PartProportion, PartProportion, PartProportion)
Part.Parent = workspace.Terrain
end
end
end
wait()
end