I’ve been trying to make a planet generation with the roblox terrain using :FillBall. Here is what I did, it just generates a terrain ball in random positions and also with random material.
for i = 1,100 do
local material = math.random(1,4)
if material == 1 then
local size = math.random(5,500)
local randomposX = math.random(-10000,10000)
local randomposY = math.random(-10000,10000)
local randomposZ = math.random(-10000,10000)
game.Workspace.Terrain:FillBall(Vector3.new(randomposX,randomposY,randomposZ), size, Enum.Material.Ground)
end
if material == 2 then
local size = math.random(5,500)
local randomposX = math.random(-10000,10000)
local randomposY = math.random(-10000,10000)
local randomposZ = math.random(-10000,10000)
game.Workspace.Terrain:FillBall(Vector3.new(randomposX,randomposY,randomposZ), size, Enum.Material.CrackedLava)
end
if material == 3 then
local size = math.random(5,500)
local randomposX = math.random(-10000,10000)
local randomposY = math.random(-10000,10000)
local randomposZ = math.random(-10000,10000)
game.Workspace.Terrain:FillBall(Vector3.new(randomposX,randomposY,randomposZ), size, Enum.Material.Rock)
end
if material == 4 then
local size = math.random(5,500)
local randomposX = math.random(-10000,10000)
local randomposY = math.random(-10000,10000)
local randomposZ = math.random(-10000,10000)
game.Workspace.Terrain:FillBall(Vector3.new(randomposX,randomposY,randomposZ), size, Enum.Material.Ice)
end
if material == 5 then
local size = math.random(5,500)
local randomposX = math.random(-10000,10000)
local randomposY = math.random(-10000,10000)
local randomposZ = math.random(-10000,10000)
game.Workspace.Terrain:FillBall(Vector3.new(randomposX,randomposY,randomposZ), size, Enum.Material.Slate)
end
end