Heh, back for round 2 I see. This is a bit more difficult than your first question, but I'll do my best to help you answer it.
In this case, the use of or is not correct. It won't know how to choose one or the other, all it knows is that they're all choices. Instead, you'll want to use a randomizing system --
local num = math.random(2)
if num == 1 then
leaf.BrickColor = BrickColor.new("Sand Green")
elseif num == 2 then
leaf.BrickColor = BrickColor.new("Medium Green")
end
This picks a random whole number between 1 and 2, and then changes the BrickColor of the block.
You also need to add the = BrickColor.new() piece, or else it won't know how to set the color.
As a bonus, you can also set the colors to non-ROBLOX colors. You can use a site such as this and use the R, G, and B ccomponents (in that order) to select your colors. Just use this format instead of ("Medium Green") --
leaf.BrickColor = BrickColor.new(R/255, G/255, B/255)
2 comments
Well RoboFrog. It works alright. But one problem.. It changes the color yes it does. It changes the color to Light Stone Gray...
That's quite strange, I don't see why it's doing that. I would go with DevFrank's answer then, since a table is likely a better answer (unless you want weighted choices, in which case I could find the issue).