Testing random terrain generation but gives same result

hello, im creating an terrain generation using 3d perlin noise but it gives same result

test1:
image

test2:
image

here’s the server (the only script in the game):

local Terrain = workspace.Terrain

local mapXsize = 64
local mapYsize = 64
local mapZsize = 64
local seed = math.random(0,1000000)
local noiseScale = 30
local amplitude = 20
local blockSize = 2

print("here's the seed:", seed)

for x=0,mapXsize do
	for z=0,mapZsize do
		for y=0,mapYsize do
			local Xnoise = math.noise(y/noiseScale,z/noiseScale, noiseScale/seed)*amplitude
			local Ynoise = math.noise(x/noiseScale,z/noiseScale, noiseScale/seed)*amplitude
			local Znoise = math.noise(x/noiseScale,y/noiseScale, noiseScale/seed)*amplitude
			
			local density = Xnoise + Ynoise + Znoise + y
			if density < 20 and density > 10 then
				local cframe = CFrame.new(x*blockSize,y*blockSize,z*blockSize)
				local size = Vector3.new(blockSize,blockSize,blockSize)
				Terrain:FillBlock(cframe, size, Enum.Material.Grass)
			end
		end
	end
end

please help me idk how to fix it :cry:

1 Like

Try adding the seed instead of dividing by it.

but i watched this tutorial to do it:

it worked but the save file was corrupted so i had to restart :cry:

and i had to divide it or it was not equal to the noisescale