Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local seed = (math.random() - .5)*2^16
- local IT_X = 500
- local IT_Z = 500
- local size = Vector3.new(4, 1, 4)
- local snow = 7/8
- local rock = 5/8
- local grass = 3/8
- local sand = 2/8
- local terrain = true
- local amplitude = 500
- local detail = 70
- local offset = Vector3.new(0, 2, 0) + owner.Character.HumanoidRootPart.Position
- function color(noise)
- local unamnoise = noise/amplitude
- if unamnoise > snow then
- if terrain then
- return Enum.Material.Snow
- end
- return Color3.new(1,1,1)
- end
- if unamnoise > rock and unamnoise < snow then
- if terrain then
- return Enum.Material.Rock
- end
- return Color3.new(.5, .5, .5)
- end
- if unamnoise > grass and unamnoise < rock then
- if terrain then
- return Enum.Material.Grass
- end
- return Color3.new(.1, .8, .1)
- end
- if unamnoise > sand and unamnoise < grass then
- if terrain then
- return Enum.Material.Sand
- end
- return Color3.new(.9, .9, .7)
- end
- if unamnoise < sand then
- if terrain then return Enum.Material.Water end
- return Color3.new(.2, .2, 1)
- end
- end
- function MakeTheStuff(xpos, zpos)
- local noise = math.max((math.noise(xpos/detail + seed, zpos/detail + seed) + .5), sand - .01)*amplitude
- local part = Instance.new("SpawnLocation", script)
- part.Size = Vector3.new(size.X, noise, size.Z)
- part.Position = Vector3.new(xpos, noise/2, zpos)*size + offset
- part.Anchored = true
- part.Enabled = false
- part.Material = "SmoothPlastic"
- if noise == 0 then
- print(noise)
- end
- if terrain then
- workspace.Terrain:FillBlock(part.CFrame, part.Size, color(noise))
- part.Parent = nil
- else
- part.Color = color(noise)
- end
- end
- function run(xpos, zpos)
- local s, e = pcall(function() MakeTheStuff(xpos, zpos) end)
- if e then
- task.wait()
- run(xpos, zpos)
- end
- end
- for x = 1,IT_X do
- for z = 1,IT_Z do
- run(x, z)
- end
- task.wait(.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement