|
| 05 Mar 2012 11:51 AM |
local tab = { x1 = 10, z1 = 10, x2 = 5, z2 = 5, rand = 0, randf = math.random(-5, 5), color = { "Bright green", "Dark green", "Bright bluish green" }, mats = { "Grass" } } function correctifyObject(obj) objSize = obj.Size if objSize.Y < 1.2*2 then obj.BrickColor = BrickColor.new(tab.color[3]) elseif objSize.Y > 1.2*2 and objSize.Y < 1.2*10 then obj.BrickColor = BrickColor.new(tab.color[1]) obj.Material = tab.mats[1] else obj.BrickColor = BrickColor.new(tab.color[2]) obj.Material = tab.mats[1] end end for aa = 0, tonumber(tab.x1) do for ab = 0, tonumber(tab.z1) do local part = Instance.new("Part", game.Workspace) part.Anchored = true tab.randf = math.random(-5, 5) * 0.1 if tab.randf > 0 then tab.rand = tab.rand - tab.randf elseif tab.randf < 0 then tab.rand = tab.rand + tab.randf end part.Size = Vector3.new(tab.x2, tab.rand, tab.z2) correctifyObject(part) part.CFrame = CFrame.new(aa * tab.x2, part.Size.Y / 2, ab * tab.z2) part.TopSurface = "Smooth" part.BottomSurface = "Smooth" print("rand", tab.rand, "rand_factor", tab.randf, "absolute value of rand", math.abs(tab.rand), "absolute value of randf", math.abs(tab.randf)) wait() end end
|
|
|
| Report Abuse |
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 05 Mar 2012 12:34 PM |
This is how I make my terrain smoother,
for x = 1, 100 do ~xvg for y = 1, 100 do for z = 1, 100 do workspace.Terrain:SetCell(x, y, z, 1, 0, 0) end end end
|
|
|
| Report Abuse |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 05 Mar 2012 12:37 PM |
XD
That made me laugh seeing how big the script was then xv came XD |
|
|
| Report Abuse |
|
|
| 05 Mar 2012 01:27 PM |
There's been a shorter way? fuuuuuuuuu |
|
|
| Report Abuse |
|