generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Building Helpers
Home Search
 

Re: Terrain generator script

Previous Thread :: Next Thread 
SimonsTheory is not online. SimonsTheory
Joined: 11 Feb 2013
Total Posts: 159
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 is not online. c00l43v3r
Joined: 28 Dec 2010
Total Posts: 4968
08 Nov 2013 10:22 AM
Officially cool.

-KThxBai-
Report Abuse
SimonsTheory is not online. SimonsTheory
Joined: 11 Feb 2013
Total Posts: 159
08 Nov 2013 04:48 PM
Thanks
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
08 Nov 2013 05:00 PM
LocalScript or Script?
Report Abuse
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
08 Nov 2013 08:31 PM
@John Script
Report Abuse
SimonsTheory is not online. SimonsTheory
Joined: 11 Feb 2013
Total Posts: 159
09 Nov 2013 03:06 AM
Regular script
Report Abuse
SimonsTheory is not online. SimonsTheory
Joined: 11 Feb 2013
Total Posts: 159
13 Nov 2013 02:43 AM
Lol This is my favorite script!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Building Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image