Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local size = 40--Size of Terrain Bricks(Smallest Size)
- local maxsize = 70--Size of Terrain Bricks(Largest Size)
- local tilt = math.random(-12,12) --Tilt of terrain(0 for no tilt) Best to be between 0 to 12
- local amount = 300 --Amount of Bricks
- width = 200 -- Max Width of Terrain
- height = 30 --Max Height of Terrain(HAS TO BE EVEN NUMBER!!)
- terrain = 1 --Type Of Terrain (0=Sphere,1=Brick,2=Cylinder)
- water = true --Put false for no Water
- watersize = 20 --Size(If water is true) Best to be inBetween 2 to 12
- waterlevel = 2 --height of water(If water is true) Should be between 1 to 2 (Lower Number creates less land Above water)
- customcolor = "Olivine" --Terrain BrickColor(If autocolor is false)
- material = "Grass" --Terrain Material
- autocolor = true --Automatic Terrain Coloring(set false for no autocolor)
- trees = true --Set to false if You want No trees --->(A Bit Glitchy) :/
- treeamount = 200 --Number of Trees
- leavetrim = 1 --Shape Of Leaves(0=Sphere,1=Brick,2=Cylinder)
- leavesize = 20 --Size of leaves
- --
- --
- --------------------------------------
- --Don't Mess with the Below--|
- -------------------------------------------------------------------------------------------------------------------------------------------------------------
- local m = Instance.new("Message",workspace)
- m.Text = "Prepare yourself for terrain generation in 5..."
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxasset://sounds/electronicpingshort.wav"
- s.Volume = 1
- s.Pitch = 2.7
- s.PlayOnRemove = true
- s:Remove()
- wait(1)
- m.Text = "Prepare yourself for terrain generation in 4..."
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxasset://sounds/electronicpingshort.wav"
- s.Volume = 1
- s.Pitch = 2.7
- s.PlayOnRemove = true
- s:Remove()
- wait(1)
- m.Text = "Prepare yourself for terrain generation in 3..."
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxasset://sounds/electronicpingshort.wav"
- s.Volume = 1
- s.Pitch = 2.7
- s.PlayOnRemove = true
- s:Remove()
- wait(1)
- m.Text = "Prepare yourself for terrain generation in 2..."
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxasset://sounds/electronicpingshort.wav"
- s.Volume = 1
- s.Pitch = 2.7
- s.PlayOnRemove = true
- s:Remove()
- wait(1)
- m.Text = "Prepare yourself for terrain generation in 1..."
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxasset://sounds/electronicpingshort.wav"
- s.Volume = 1
- s.Pitch = 2.7
- s.PlayOnRemove = true
- s:Remove()
- wait(1)
- local h = Instance.new("Hint",workspace)
- h.Text = "Please wait for the generation to complete."
- local collect = Instance.new("Model")
- collect.Parent = game.Workspace
- collect.Name = "Terrain"
- rock = "Dark stone grey"
- grass = {"Bright green","Dark green","Olive","Olivine","Moss","Forest green","Sea green","Medium green","Mint","Pastel green","Sand green","Br. yellowish green","Artichoke","Sage green","Grime","Camo","Shamrock","Parsley green","Earth green","Slime green"}
- sand = "Brick yellow"
- local value = 0
- for i = 1,amount do -->Main function
- value = value +1
- m.Text = "Adding Terrain #"..value
- local land = Instance.new("Part")
- land.Name = "Land "..value
- land.Parent = collect
- land.Anchored = true
- land.Shape = terrain
- land.Material = material
- e = math.random(size,maxsize)
- land.Size = Vector3.new(e,e,e)
- if autocolor == false then land.BrickColor = BrickColor.new(customcolor) end
- land.CFrame = CFrame.new(math.random(-width,width),math.random(0,height),math.random(-width,width))
- --land.CFrame = CFrame.new(math.random(-posX,posZ),math.random(-depth,height),math.random(-posX,posZ))
- land.CFrame = land.CFrame * CFrame.fromEulerAnglesXYZ(0,tilt,0)
- grasses = grass[math.random(1, #grass)]
- local k = Instance.new("Hint",workspace)
- k.Text = "autocolor was set true! autocoloring..." --autocolor Responses below
- k:Remove()
- if autocolor == true and land.Position.y >= height/1.125 then
- land.BrickColor = BrickColor.new(rock)
- land.Material = "Slate"
- end
- if autocolor == true and land.Position.y >= height/4 and land.Position.y <= height/1.125 then
- land.BrickColor = BrickColor.new(grasses)
- end
- if autocolor == true and land.Position.y <= height/4 then
- land.BrickColor = BrickColor.new(sand)
- land.Material = "Sand"
- end
- wait()
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxassetid://15666462"
- s.Volume = 1
- s.Pitch = 3.6
- s.PlayOnRemove = true
- s:Remove()
- end
- --extras v
- local value2 = 0
- m.Text = "Creating trees..."
- if trees == true then
- for t = 1,treeamount do --Who would of known the complications...of growing a Tree...
- value2 = value2 +1
- local tree = Instance.new("Model")
- tree.Parent = collect
- tree.Name = "Tree " ..value2
- local trunk = Instance.new("Part")
- trunk.Parent = tree
- trunk.Name = "Trunk"
- trunk.Material = "Wood"
- trunk.Anchored = true
- trunk.Size = Vector3.new(2,height +height*0.7,2)
- trunk.BrickColor = BrickColor.new("Brown") --Hard To set CFrames for these
- trunk.CFrame = CFrame.new(math.random(-width,width),math.random(height/1.1,height +height*0.7),math.random(-width,width))
- local leaves = Instance.new("Part")
- leaves.Parent = tree
- leaves.Name = "Leaves"
- leaves.Material = "Grass"
- leaves.Anchored = true
- leaves.Shape = leavetrim
- leaves.Size = Vector3.new(leavesize,leavesize,leavesize)
- leaves.BrickColor = BrickColor.new(grasses)
- leaves.CFrame = trunk.CFrame + Vector3.new(0,trunk.Size.y*0.5,0)
- leaves.CanCollide = false
- wait()
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxassetid://15666462"
- s.Volume = 1
- s.Pitch = 1.4
- s.PlayOnRemove = true
- s:Remove()
- end
- end
- if water == true then
- m.Text = "Ok to make Water"
- local water = Instance.new("Part")
- water.Name = "Water"
- water.Parent = collect
- water.Transparency = 0.5
- water.CanCollide = false
- water.Anchored = true
- water.TopSurface = "Smooth"
- water.BottomSurface = "Smooth"
- water.BrickColor = BrickColor.new("Bright bluish green")
- water.Size = Vector3.new(width*watersize,1,width*watersize)
- water.CFrame = CFrame.new(0,height/waterlevel,0) --Possible Glitches?
- workspace.Base:Remove()
- end
- m.Text = "Completed Terrain Generation"
- h.Text = "Completed Terrain Generation"
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxasset://sounds/electronicpingshort.wav"
- s.Volume = 1
- s.Pitch = 2.7
- s.PlayOnRemove = true
- s:Remove()
- wait(2)
- m:Remove()
- h:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement