Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------
- --#----~~~dylanbuider~~~----#-- NEW: Tilt Affect for Terrain!
- -------------------------------------------
- ----()----Terrain Script v1.5----()---- [ If You Use, Please Give me Credit :) Thank You. ]
- ------------------------------------------- Very Experimental Script. Have Fun :3
- local size = 40--Size of Terrain Bricks(Smallest Size)
- local maxsize = 70--Size of Terrain Bricks(Largest Size)
- local tilt = 0 --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 = 2 --Type Of Terrain (0=Sphere,1=Brick,2=Cylinder)
- water = false --Put false for no Water
- watersize = 4 --Size(If water is true) Best to be inBetween 2 to 12
- waterlevel = 1 --height of water(If water is true) Should be between 1 to 2 (Lower Number creates less land Above water)
- customcolor = "Bright green" --Terrain BrickColor(If autocolor is false)
- material = "Plastic" --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 = 30 --Number of Trees
- leavetrim = 0 --Shape Of Leaves(0=Sphere,1=Brick,2=Cylinder)
- leavesize = 10 --Size of leaves
- --
- --
- --------------------------------------
- --Don't Mess with the Below--|
- -------------------------------------------------------------------------------------------------------------------------------------------------------------
- local collect = Instance.new("Model")
- collect.Parent = game.Workspace
- collect.Name = "Terrain"
- rock = "Dark stone grey"
- grass = {"Bright green","Bright green","Earth green"}
- sand = "Brick yellow"
- local value = 0
- for i = 1,amount do -->Main function
- value = value +1
- print("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)]
- print("autocolor was set true! autocoloring...") --autocolor Responses below
- if autocolor == true and land.Position.y >= height/1.125 then land.BrickColor = BrickColor.new(rock) 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) end
- wait()
- end
- --extras v
- local value2 = 0
- 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("Reddish 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 = "Ice" --Not Really Ice ._.
- leaves.Anchored = true
- leaves.Shape = leavetrim
- leaves.Size = Vector3.new(leavesize,leavesize,leavesize)
- leaves.BrickColor = BrickColor.new("Camo")
- leaves.CFrame = trunk.CFrame + Vector3.new(0,trunk.Size.y*0.5,0)
- wait()
- end
- end
- if water == true then
- print("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 blue")
- water.Size = Vector3.new(width*watersize,1,width*watersize)
- water.CFrame = CFrame.new(0,height/waterlevel,0) --Possible Glitches?
- end
- print("Competed Terrain Generation")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement