Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HeightVariation=2 --The Higher this number is the more "Hilly" the maps are going to get.(Measured in Studs)
- BiomeSize=600 --This is half the length/width of the Biome Squares
- PartsPerBiome=200
- TreesInForest=200
- TreesInSavannah=100
- MaxBlockSize=100
- MinimumBlockSize=80
- BiomeSquares=5 --Choose an integer 1-5, 5 will have 25 Biome squares, and 1 will have 1.
- game.Lighting.TimeOfDay = "12:00:00"
- function Swamp(x,z)
- local Colors = {"Bright green","Dark green", "Camo", "Earth green", "Br. yellowish green"}
- local f=Instance.new("Part")
- f.Anchored = true
- f.Name="Waka"
- f.Color = Color3.new(0, 0, 1)
- f.CFrame = CFrame.new(x, 7, z)
- f.Transparency = 0.4
- f.CanCollide = false
- f.Size = Vector3.new(BiomeSize*2, 20, BiomeSize*2)
- f.Parent = game.Workspace
- for i=1,PartsPerBiome do
- local h = Instance.new("SpawnLocation")
- h.Position = Vector3.new(math.random(x-BiomeSize, x+BiomeSize), 1+math.random(-1*HeightVariation, HeightVariation), math.random(z-BiomeSize, z+BiomeSize))
- h.Anchored = true
- h.Name = "Waka"
- h.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)])
- h.Size = Vector3.new(math.random(MinimumBlockSize,MaxBlockSize), math.random(4, 50), math.random(MinimumBlockSize, MaxBlockSize))
- h:clone().Parent = game.Workspace
- wait(0.001)
- end
- end
- function Mount(x,z)
- local Colors = {"Medium stone grey", "Black", "Light stone grey"}
- local f=Instance.new("Part")
- f.Anchored = true
- f.Name="Waka"
- f.BrickColor = BrickColor.new("Medium stone grey")
- f.CFrame = CFrame.new(x, 7, z)
- f.Transparency = 0
- f.CanCollide = true
- f.Size = Vector3.new(BiomeSize*2, 20, BiomeSize*2)
- f.Parent = game.Workspace
- for i=1,PartsPerBiome do
- local h = Instance.new("SpawnLocation")
- h.Position = Vector3.new(math.random(x-BiomeSize, x+BiomeSize), 17+math.random(-1*HeightVariation, HeightVariation), math.random(z-BiomeSize, z+BiomeSize))
- h.Anchored = true
- h.Name = "Waka"
- h.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)])
- h.Size = Vector3.new(math.random(MinimumBlockSize,MaxBlockSize), math.random(4, 50), math.random(MinimumBlockSize, MaxBlockSize))
- h:clone().Parent = game.Workspace
- wait(0.001)
- end
- end
- function Sand(x,z)
- local Colors = {"Cool yellow", "CGA brown", "Deep orange", "Pastel yellow"}
- local f=Instance.new("Part")
- f.Anchored = true
- f.Name="Waka"
- f.BrickColor = BrickColor.new("Deep orange")
- f.CFrame = CFrame.new(x, 7, z)
- f.Transparency = 0
- f.CanCollide = true
- f.Size = Vector3.new(BiomeSize*2, 20, BiomeSize*2)
- f.Parent = game.Workspace
- for i=1,PartsPerBiome do
- local h = Instance.new("SpawnLocation")
- h.Position = Vector3.new(math.random(x-BiomeSize, x+BiomeSize), 17+math.random(-1*HeightVariation, HeightVariation), math.random(z-BiomeSize, z+BiomeSize))
- h.Anchored = true
- h.Name = "Waka"
- h.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)])
- h.Size = Vector3.new(math.random(MinimumBlockSize,MaxBlockSize), math.random(4, 50), math.random(MinimumBlockSize, MaxBlockSize))
- h:clone().Parent = game.Workspace
- wait(0.001)
- end
- end
- function Forest(x,z)
- local Colors = {"Bright green"}
- local f=Instance.new("Part")
- f.Anchored = true
- f.Name="Waka"
- f.BrickColor = BrickColor.new("Bright green")
- f.CFrame = CFrame.new(x, 7, z)
- f.Transparency = 0
- f.CanCollide = true
- f.Size = Vector3.new(BiomeSize*2, 20, BiomeSize*2)
- f.Parent = game.Workspace
- for i=1,PartsPerBiome do
- local h = Instance.new("SpawnLocation")
- h.Position = Vector3.new(math.random(x-BiomeSize, x+BiomeSize), 17+math.random(-1*HeightVariation, HeightVariation), math.random(z-BiomeSize, z+BiomeSize))
- h.Anchored = true
- h.Name = "Waka"
- h.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)])
- h.Size = Vector3.new(math.random(MinimumBlockSize,MaxBlockSize), math.random(4, 50), math.random(MinimumBlockSize, MaxBlockSize))
- h:clone().Parent = game.Workspace
- wait(0.001)
- end
- local Base = Instance.new("Part")
- Base.Name = "Trunk"
- Base.formFactor = "Custom"
- Base.TopSurface = 0
- Base.BottomSurface = 0
- Base.Anchored = true
- Base.BrickColor = BrickColor.new("Reddish brown")
- local Leaves = Base:Clone()
- Leaves.Name = "Leaves"
- Leaves.CanCollide = false
- Leaves.BrickColor = BrickColor.new("Dark green")
- local leafmesh = Instance.new("SpecialMesh")
- leafmesh.MeshType = "FileMesh"
- leafmesh.MeshId = "http://www.roblox.com/asset/?id=1290033"
- leafmesh.TextureId = "http://www.roblox.com/asset/?id=2861779"
- leafmesh.Parent = Leaves
- Instance.new("CylinderMesh",Base)
- function dot(c1,c2)
- local m = CFrame.Angles(math.pi/2,0,0)
- return (c1*m).lookVector:Dot((c2*m).lookVector)
- end
- local leaf_mult = {
- Vector3.new(1.5,1.5,1.2);
- Vector3.new(1.5,1,1.5);
- Vector3.new(1.2,1.5,1.5);
- Vector3.new(1.5,1.5,1.5);
- }
- function Branch(base,c)
- if c <= 0 then
- local leaves = Leaves:Clone()
- local vol = base.Size.x+base.Size.y+base.Size.z
- leaves.Mesh.Scale = leaf_mult[math.random(1,#leaf_mult)]*math.random(vol/3*10,vol/3*12)/10
- leaves.Size = leaves.Mesh.Scale*0.75
- leaves.CFrame = base.CFrame * CFrame.new(0,base.Size.y/2,0)
- leaves.Parent = base.Parent
- else
- local pos = base.CFrame*CFrame.new(0,base.Size/2,0)
- local height = base.Size.y
- local width = base.Size.x
- local nb = math.random(2,2)
- local r = math.random(45,135)
- local da = math.random(20+55/c,40+40/c)
- local ba = math.random(-da/3,da/3)
- for i=0,nb-1 do
- local branch = base:Clone()
- branch.Name = "Branch"
- local h = height*math.random(95,115)/100
- local new = branch.CFrame * CFrame.new(0,height/2,0) * CFrame.Angles(0,0,math.rad(ba))
- new = new * CFrame.Angles(0,i*(math.pi*2/nb)+r,math.rad(da/2)) * CFrame.new(0,h/2,0)
- local w = dot(new,branch.CFrame)*width*0.9
- branch.Size = Vector3.new(w,h,w)
- branch.CFrame = new
- branch.Parent = base.Parent
- Branch(branch,c-1)
- end
- end
- end
- function _G.Tree(location,complexity,width,height)
- local tree = Instance.new("Model")
- tree.Name = "Waka"
- tree.archivable = false
- tree.Parent = workspace
- local base = Base:Clone()
- base.Parent = tree
- base.Size = Vector3.new(width,height,width)
- -- move up by half its height, and rotate randomly
- base.CFrame = location * CFrame.new(0,height/2,0) * CFrame.Angles(0,math.rad(math.random(1,360)),0)
- -- start branching
- Branch(base,complexity)
- return tree
- end
- for i=1,TreesInForest do
- _G.Tree(CFrame.new(math.random(x-BiomeSize, x+BiomeSize), 17, math.random(z-BiomeSize, z+BiomeSize)),3,4,20)
- end
- end
- function Savannah(x,z)
- local Colors = {"Bright green"}
- local f=Instance.new("Part")
- f.Anchored = true
- f.Name="Waka"
- f.BrickColor = BrickColor.new("Bright green")
- f.CFrame = CFrame.new(x, 7, z)
- f.Transparency = 0
- f.CanCollide = true
- f.Size = Vector3.new(BiomeSize*2, 20, BiomeSize*2)
- f.Parent = game.Workspace
- for i=1,PartsPerBiome do
- local h = Instance.new("SpawnLocation")
- h.Position = Vector3.new(math.random(x-BiomeSize, x+BiomeSize), 17+math.random(-1*HeightVariation, HeightVariation), math.random(z-BiomeSize, z+BiomeSize))
- h.Anchored = true
- h.Name = "Waka"
- h.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)])
- h.Size = Vector3.new(math.random(MinimumBlockSize,MaxBlockSize), math.random(4, 50), math.random(MinimumBlockSize, MaxBlockSize))
- h:clone().Parent = game.Workspace
- wait(0.001)
- end
- local Base = Instance.new("Part")
- Base.Name = "Trunk"
- Base.formFactor = "Custom"
- Base.TopSurface = 0
- Base.BottomSurface = 0
- Base.Anchored = true
- Base.BrickColor = BrickColor.new("Reddish brown")
- local Leaves = Base:Clone()
- Leaves.Name = "Leaves"
- Leaves.CanCollide = false
- Leaves.BrickColor = BrickColor.new("Dark green")
- local leafmesh = Instance.new("SpecialMesh")
- leafmesh.MeshType = "FileMesh"
- leafmesh.MeshId = "http://www.roblox.com/asset/?id=1290033"
- leafmesh.TextureId = "http://www.roblox.com/asset/?id=2861779"
- leafmesh.Parent = Leaves
- Instance.new("CylinderMesh",Base)
- function dot(c1,c2)
- local m = CFrame.Angles(math.pi/2,0,0)
- return (c1*m).lookVector:Dot((c2*m).lookVector)
- end
- local leaf_mult = {
- Vector3.new(1.5,1.5,1.2);
- Vector3.new(1.5,1,1.5);
- Vector3.new(1.2,1.5,1.5);
- Vector3.new(1.5,1.5,1.5);
- }
- function Branch(base,c)
- if c <= 0 then
- local leaves = Leaves:Clone()
- local vol = base.Size.x+base.Size.y+base.Size.z
- leaves.Mesh.Scale = leaf_mult[math.random(1,#leaf_mult)]*math.random(vol/3*10,vol/3*12)/10
- leaves.Size = leaves.Mesh.Scale*0.75
- leaves.CFrame = base.CFrame * CFrame.new(0,base.Size.y/2,0)
- leaves.Parent = base.Parent
- else
- local pos = base.CFrame*CFrame.new(0,base.Size/2,0)
- local height = base.Size.y
- local width = base.Size.x
- local nb = math.random(2,2)
- local r = math.random(45,135)
- local da = math.random(20+55/c,40+40/c)
- local ba = math.random(-da/3,da/3)
- for i=0,nb-1 do
- local branch = base:Clone()
- branch.Name = "Branch"
- local h = height*math.random(95,115)/100
- local new = branch.CFrame * CFrame.new(0,height/2,0) * CFrame.Angles(0,0,math.rad(ba))
- new = new * CFrame.Angles(0,i*(math.pi*2/nb)+r,math.rad(da/2)) * CFrame.new(0,h/2,0)
- local w = dot(new,branch.CFrame)*width*0.9
- branch.Size = Vector3.new(w,h,w)
- branch.CFrame = new
- branch.Parent = base.Parent
- Branch(branch,c-1)
- end
- end
- end
- function _G.Tree(location,complexity,width,height)
- local tree = Instance.new("Model")
- tree.Name = "Waka"
- tree.archivable = false
- tree.Parent = workspace
- local base = Base:Clone()
- base.Parent = tree
- base.Size = Vector3.new(width,height,width)
- -- move up by half its height, and rotate randomly
- base.CFrame = location * CFrame.new(0,height/2,0) * CFrame.Angles(0,math.rad(math.random(1,360)),0)
- -- start branching
- Branch(base,complexity)
- return tree
- end
- for i=1,TreesInSavannah do
- _G.Tree(CFrame.new(math.random(x-BiomeSize, x+BiomeSize), 1, math.random(z-BiomeSize, z+BiomeSize)),3,4,20)
- end
- end
- function find(X,Z)
- local R=math.random(1,5)
- if R==1 then
- Swamp(X,Z)
- end
- if R==2 then
- Mount(X,Z)
- end
- if R==3 then
- Sand(X,Z)
- end
- if R==4 then
- Forest(X,Z)
- end
- if R==5 then
- Savannah(X,Z)
- end
- end
- if BiomeSquares==1 then
- find(BiomeSize*-3,BiomeSize*-3)
- end
- if BiomeSquares==2 then
- find(BiomeSize*-3,BiomeSize*-3)
- find(BiomeSize*-1,BiomeSize*-3)
- find(BiomeSize*-3,BiomeSize*-1)
- find(BiomeSize*-1,BiomeSize*-1)
- end
- if BiomeSquares==3 then
- find(BiomeSize*-3,BiomeSize*-3)
- find(BiomeSize*-1,BiomeSize*-3)
- find(BiomeSize,BiomeSize*-3)
- find(BiomeSize*-3,BiomeSize*-1)
- find(BiomeSize*-1,BiomeSize*-1)
- find(BiomeSize,BiomeSize*-1)
- find(BiomeSize*-3,BiomeSize)
- find(BiomeSize*-1,BiomeSize)
- find(BiomeSize,BiomeSize)
- end
- if BiomeSquares==4 then
- find(BiomeSize*-3,BiomeSize*-3)
- find(BiomeSize*-1,BiomeSize*-3)
- find(BiomeSize,BiomeSize*-3)
- find(BiomeSize*3,BiomeSize*-3)
- find(BiomeSize*-3,BiomeSize*-1)
- find(BiomeSize*-1,BiomeSize*-1)
- find(BiomeSize,BiomeSize*-1)
- find(BiomeSize*3,BiomeSize*-1)
- find(BiomeSize*-3,BiomeSize)
- find(BiomeSize*-1,BiomeSize)
- find(BiomeSize,BiomeSize)
- find(BiomeSize*3,BiomeSize)
- find(BiomeSize*-3,BiomeSize*3)
- find(BiomeSize*-1,BiomeSize*3)
- find(BiomeSize,BiomeSize*3)
- find(BiomeSize*3,BiomeSize*3)
- end
- if BiomeSquares==5 then
- find(BiomeSize*-3,BiomeSize*-3)
- find(BiomeSize*-1,BiomeSize*-3)
- find(BiomeSize,BiomeSize*-3)
- find(BiomeSize*3,BiomeSize*-3)
- find(BiomeSize*5,BiomeSize*-3)
- find(BiomeSize*-3,BiomeSize*-1)
- find(BiomeSize*-1,BiomeSize*-1)
- find(BiomeSize,BiomeSize*-1)
- find(BiomeSize*3,BiomeSize*-1)
- find(BiomeSize*5,BiomeSize*-1)
- find(BiomeSize*-3,BiomeSize)
- find(BiomeSize*-1,BiomeSize)
- find(BiomeSize,BiomeSize)
- find(BiomeSize*3,BiomeSize)
- find(BiomeSize*5,BiomeSize)
- find(BiomeSize*-3,BiomeSize*3)
- find(BiomeSize*-1,BiomeSize*3)
- find(BiomeSize,BiomeSize*3)
- find(BiomeSize*3,BiomeSize*3)
- find(BiomeSize*5,BiomeSize*3)
- find(BiomeSize*-3,BiomeSize*5)
- find(BiomeSize*-1,BiomeSize*5)
- find(BiomeSize,BiomeSize*5)
- find(BiomeSize*3,BiomeSize*5)
- find(BiomeSize*5,BiomeSize*5)
- end
Add Comment
Please, Sign In to add comment