How would i make that?
✓ ANSWER ACCEPTED
Random BrickColor, how about Random Materials?
1 answer
✓ Accepted answer
BrickColor.Random()
Makes a Random BrickColor.
Making a random Material is harder only because Material is an Enum, as opposed to an Object like BrickColor.
--First, let's make a dictionary of the possible Materials:
local mats = {}
for _, v in pairs(Enum.Material:GetEnumItems()) do --Rather than hard code the values, populate the list based on the *current* Materials.
mats[v.Name] = v
end
function MaterialRandom() --let's make this a function...
return mats[math.random(#mats)] --And return one of the random members of that Table.
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Is it also possible to do a math.random on a table of strings of the materials?
Yeah it is, but it will return the position instead of the value itself. math.random(1, #mats) will return a random POSITION of a material rather than the actual material itself. To refer to the value, you would set a variable for the position, and use mats[VARIABLE]