|
| 08 May 2013 08:01 AM |
for i = 1, 1000 do p = Instance.new("Part") p.Anchored = true p.Position = Vector3.new(math.random(512,0), math.random(10,-10), math.random(100,-100)) p.Brickcolor = Brickcolor.random("Camo", "Bright green", "Dark green", "CGA brown", "Mid gray") p.Size = Vector3.new(math.random(20, 10) , 20, math.random(20, 10)) wait(0.03) --0.02999999999999999 is minimum wait time, I believe. end
It is supposed to generator a random 1000 block terrain.
1. Something is wrong in line 4 2. How would I add CFrame values?
Please help me? thanks |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 08 May 2013 08:08 AM |
| p.CFrame = CFrame.new(X, Y, Z) |
|
|
| Report Abuse |
|
|
|
| 08 May 2013 08:16 AM |
Okay.
for i = 1, 1000 do p = Instance.new("Part") p.Anchored = true p.Position = Vector3.new(math.random(512,0), math.random(10,-10), math.random(100,-100)) p.CFrame = CFrame.new(math.random(30, -30), math.random(30, -30), math.random(30, -30)) p.Brickcolor = Brickcolor.random("Camo", "Bright green", "Dark green", "CGA brown", "Mid gray") p.Size = Vector3.new(math.random(20, 10) , 20, math.random(20, 10)) wait(0.03) --0.02999999999999999 is minimum wait time, I believe. end
Okay, so, what is wrong with line 4 than, since the script will not run since something is apparently wrong with it... |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 08 May 2013 08:18 AM |
| I was thinking maybe you'd replace line 4 with my CFrame line. I'm not sure, however. Any output? |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 May 2013 08:28 AM |
| 07:27:41.814 - Workspace.Script:4: bad argument #2 to 'random' (interval is empty) |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 08 May 2013 08:30 AM |
| Can you give me the script? |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 May 2013 08:35 AM |
Oh crap, I realized I just messed up...
I meant Angular CFrame, I should have said that.
Idiocy on my part. |
|
|
| Report Abuse |
|
|
|
| 08 May 2013 08:52 AM |
for i = 1, 1000 do p = Instance.new("Part") p.Anchored = true p.Position = Vector3.new(math.random(512,0), math.random(10,-10), math.random(100,-100)) p.CFrame = CFrame.Angles(math.random(30, -30), math.random(30, -30), math.random(30, -30)) p.Brickcolor = Brickcolor.random("Camo", "Bright green", "Dark green", "CGA brown", "Mid gray") p.Size = Vector3.new(math.random(20, 10) , 20, math.random(20, 10)) wait(0.03) --0.02999999999999999 is minimum wait time, I believe. end |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
| |
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 08 May 2013 11:33 AM |
number math.random(number lowerBound[, number upperBound]) The error you are getting is caused by having an upperBound that is smaller than lowerBound - it's illogical. Swap the order of the arguments. |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 08 May 2013 11:35 AM |
First of all...
you're doing stuff like:
math.random(100, 0)
100 is LARGER than 0. Therefore, no interval.
Also, try look up Perlin Noise or Diamondsquare generator in the Free Models.
- As, OH DAMN DINNER ! NOW UMGZ |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 08 May 2013 11:36 AM |
Oh and: p.Position = Vector3.new(math.random(512,0), math.random(10,-10), math.random(100,-100)) p.CFrame = CFrame.Angles(math.random(30, -30), math.random(30, -30), math.random(30, -30)) p.Brickcolor = Brickcolor.random("Camo", "Bright green", "Dark green", "CGA brown", "Mid gray")
should be: local rand = math.random; local rad = math.rad; p.CFrame = CFrame.new(rand(0, 512), rand(-10, 10), rand(-100, 100)) * CFrame.Angles(rad(rand(-30, 30)), rad(rand(-30, 30)), rad(rand(-30, 30))); local colours = {"Camo", "Bright green", "Dark green", "CGA brown", "Mid gray"}; p.BrickColor = BrickColor.new(colours[rad(1, #colours)]); |
|
|
| Report Abuse |
|
|