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 a red yellow green color randomizer?

I have been using the BrickColor.Random() command but what can go inside of the brackets? I tried putting BrickColor.Random("Red", "Blue", "Green") but it didn't work

1 answer

I'm pretty sure nothing goes inside the parentheses. If you want to pick a random color between red, blue, and green, I would recommend a table.

local Colors = {"Bright red","Bright blue","Dark green"} --Make sure it's a real brick color!
local randomColor = Colors[math.random(1,#Colors)]
workspace.Part.BrickColor = BrickColor.new(randomColor)

3 comments

0

the randomcolor variable would only be a number, it should be Colors[math.random(1,#Colors)], instead of math.random(1,#Colors)

0

That's correct, my mistake.

0

Thanks :D

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