|
| 08 Nov 2013 05:08 AM |
Insert this script:
local size = 40 local maxsize = 70 local tilt = 0
local amount = 300
width = 200 height = 30
terrain = 2
water = true watersize = 4 waterlevel = 1 customcolor = "Bright green" material = "Grass" autocolor = true
trees = true treeamount = 50 leavetrim = 0 leavesize = 10
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 = land.CFrame * CFrame.fromEulerAnglesXYZ(0,tilt,0) grasses = grass[math.random(1, #grass)] print("autocolor was set true! autocoloring...") 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
local value2 = 0 if trees == true then for t = 1,treeamount do 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") 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" 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) end
print("Competed Terrain Generation")
|
|
|
| Report Abuse |
|
c00l43v3r
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 4968 |
|
| |
| |
| |
| |
| |
|
| 13 Nov 2013 02:43 AM |
| Lol This is my favorite script! |
|
|
| Report Abuse |
|