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: Trying to make terrain smoother and more flattened. Need help.

Previous Thread :: Next Thread 
Terrabytes is not online. Terrabytes
Joined: 13 Jan 2012
Total Posts: 5839
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 is not online. 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 is not online. 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
Terrabytes is not online. Terrabytes
Joined: 13 Jan 2012
Total Posts: 5839
05 Mar 2012 01:27 PM
There's been a shorter way?
fuuuuuuuuu
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