Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago
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

Log in to vote
3
Answered by
yurhomi10 192
10 years ago
Part.BrickColor = BrickColor.random() -- might be wrong..
0
No it worked, thank you! Dillsion1 0 — 10y
0
NP! yurhomi10 192 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

"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))
Log in to vote
-2
Answered by
war8989 35
10 years ago

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.

Answer this question