I am trying to spawn a sphere out of a random material yet when I run the code it only spawns in the sphere as grass.
Code
local Materials = Enum.Material:GetEnumItems() β Get a table of all the possible materials
local IgnoreMaterials = {
Enum.Material.Air; Enum.Material.Water;
Enum.Material.Rock; Enum.Material.Asphalt;
Enum.Material.Snow; Enum.Material.Glacier;
Enum.Material.Sandstone; Enum.Material.Mud;
Enum.Material.Basalt; Enum.Material.Ground;
Enum.Material.CrackedLava; Enum.Material.Salt;
Enum.Material.LeafyGrass; Enum.Material.Limestone;
Enum.Material.Pavement;
} β Materials to ignore from the list
for _, material in next, IgnoreMaterials do β Removing unnecessary materials
table.remove(Materials, table.find(Materials, material))
end
local RandomMaterial = Materials[math.random(#Materials)]
print(RandomMaterial)
workspace.Terrain:FillBall(Vector3.new(0,0,0),100,RandomMaterial)