Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make this line of code have a BrickColor randomized?

if 2+2==5 or 2*2.5==5 then
	for i = 1,10 do
		x=Instance.new("Part",Workspace)
		x.Name = "Base"
		x.BrickColor =  "Bright Orange" --Problem here... so far.
		x.Size = Vector3.new(5,5,5)
		x.Position = Vector3.new(math.random(100),math.random(100),math.random(100))
		x.Transparency = math.random()
	end
end

3 answers

"Change line 5 to this:

x.BrickColor = BrickColor.new(math.random(), math.random(), math.random())

That'll select a random color."

Nope.

x.BrickColor = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))

Change line 5 to this:

x.BrickColor = BrickColor.new(math.random(), math.random(), math.random())

or...

x.BrickColor = BrickColor.random()

That'll select a random color.

This discussion is preserved as it was. New answers, comments, and votes are closed.