Webcat70

planet

Jan 2nd, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local noise = math.noise
  2.  
  3. local function GenerateBlockTerrain(arg)
  4.     for x = 0,arg.Size.X,arg.BlockSize.X do
  5.         for z = 0,arg.Size.Z,arg.BlockSize.Z do
  6.             local y = noise(arg.Seed,x/arg.Scale.X,z/arg.Scale.Z) * arg.Size.Y
  7.             local p = Instance.new("Part")
  8.             p.Parent = game.Workspace
  9.             p.FormFactor = Enum.FormFactor.Custom
  10.             p.Anchored = true
  11.             p.BrickColor = arg.Color or BrickColor.new("Camo")
  12.             p.Material = arg.Material or Enum.Material.Grass
  13.             p.Size = arg.BlockSize
  14.             p.CFrame = CFrame.new(
  15.                 (arg.MiddlePosition.X/2 - arg.Size.X/2) + x,
  16.                 (arg.MiddlePosition.Y/4 + arg.Size.Y/4) - y,
  17.                 (arg.MiddlePosition.Z/2 - arg.Size.Z/2) + z
  18.             )
  19.         end
  20.         wait()
  21.     end
  22. end
  23.  
  24. GenerateBlockTerrain{
  25.     Size = Vector3.new(325,50,325),
  26.     BlockSize = Vector3.new(5,15,5),
  27.     Seed = math.random(tick()/2,os.time()),
  28.     Scale = {X = 50,Z = 50},
  29.     MiddlePosition = Vector3.new(0,0,0)
  30. }
Add Comment
Please, Sign In to add comment