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 » Scripting Helpers
Home Search
 

Re: Help with terrain generator

Previous Thread :: Next Thread 
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
10 Sep 2011 04:13 PM
blocks = {}
size = Vector3.new(4,4,4)
started = 0

for i = 1,100 do
started = started + 1
p = Instance.new("Part")
p.Parent = game.Workspace
p.Size = size
p.BrickColor = BrickColor.new("Bright green")
p.Anchored = true
table.insert(blocks,p)
if started == 1 then
p.Position = Vector3.new(0,0,0)
elseif started > 1 then
p.Position = blocks[#blocks.Position] = blocks[#blocks.Position] + Vector3.new(0,4,0)
end
end


Output : Workspace.Script:16: unexpected symbol near '='
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
10 Sep 2011 04:14 PM
It's suppose to create a tall tower of green blocks. I kinda don't wanna players to see flat land hand-made and just generated ores.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
10 Sep 2011 04:17 PM
Try this:

blocks = {}
size = Vector3.new(4,4,4)
started = 0

for i = 1,100 do
started = started + 1
p = Instance.new("Part")
p.Parent = game.Workspace
p.Size = size
p.BrickColor = BrickColor.new("Bright green")
p.Anchored = true
table.insert(blocks,p)
if started == 1 then
p.Position = Vector3.new(0,0,0)
elseif started > 1 then
for _,v in pairs(blocks) do
p.Position = v.Position + Vector3.new(0,4,0)
end
end
end



-Like an __AWESOME__ boss
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
10 Sep 2011 04:22 PM
Thanks, how would I make it create a perfect 50x50 cube? I don't understand how to check if the line of blocks is long enough to create a new line.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting 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