How could I randomize things, like strings or materials?
local part = Instance.new("Part",workspace) part.Material = Enum.Material.Grass --I want this to be a random value instead of grass, with it still being a material.
Actually I checked with tutorials, but it can't random. Apparently you would need to make a table of all the materials and have it so it randomly chooses from the table.
local part = Instance.new("Part",workspace) TableMaterial = {"Plastic", "Wood", "WoodPlanks", "Slate", "Concrete", "Metal", "CorrodedMetal", "DiamondPlate", "Foil", "Grass", "Ice", "Brick", "Sand", "Fabric", "Granite", "Marble", "Pebble", "Cobblestone", "SmoothPlastic", "Neon", "Glass"} part.Material = (TableMaterial[math.random(#TableMaterial)])
There you go :)
Sorry, but the best way is to just do something like this:
And, loop over it with ipairs, or just follow the example.
local materials = {"Glass", "Wood", "etc."} local rand = math.random(#materials) part.Material = Enum.Material[materials[rand]]
Hope That Helped.