hello, im creating an terrain generation using 3d perlin noise but it gives same result
test1:
test2:
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