Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local noise = math.noise
- local function GenerateBlockTerrain(arg)
- for x = 0,arg.Size.X,arg.BlockSize.X do
- for z = 0,arg.Size.Z,arg.BlockSize.Z do
- local y = noise(arg.Seed,x/arg.Scale.X,z/arg.Scale.Z) * arg.Size.Y
- local p = Instance.new("Part")
- p.Parent = game.Workspace
- p.FormFactor = Enum.FormFactor.Custom
- p.Anchored = true
- p.BrickColor = arg.Color or BrickColor.new("Camo")
- p.Material = arg.Material or Enum.Material.Grass
- p.Size = arg.BlockSize
- p.CFrame = CFrame.new(
- (arg.MiddlePosition.X/2 - arg.Size.X/2) + x,
- (arg.MiddlePosition.Y/4 + arg.Size.Y/4) - y,
- (arg.MiddlePosition.Z/2 - arg.Size.Z/2) + z
- )
- end
- wait()
- end
- end
- GenerateBlockTerrain{
- Size = Vector3.new(325,50,325),
- BlockSize = Vector3.new(5,15,5),
- Seed = math.random(tick()/2,os.time()),
- Scale = {X = 50,Z = 50},
- MiddlePosition = Vector3.new(0,0,0)
- }
Add Comment
Please, Sign In to add comment