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

My Brick will not change colors?

Asked by 5 years ago

Im new to scripting and am wanting to create a script that changes colors after 0.5 seconds. But the one I made seemed not to work? Can someone please tell me what I did wrong here?

local CB = script.Parent


CB.Color = BrickColor.Red()
wait(0.5)
CB.Color = BrickColor.Blue()
wait(0.5)
CB.Color = BrickColor.Green()
wait(0.5)


Thanks In advance

2
Change CB.Color to CB.BrickColor yHasteeD 1819 — 5y
0
and change BrickColor. to BrickColor.new("Color here") Gameplayer365247v2 1055 — 5y
0
^ it can also be BrickColor.Red() too, just those are the default colors, by using the parenthesis, you get a wider range of colors. greatneil80 2647 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

This is what you'd want to do:

local CB = script.Parent


CB.BrickColor = BrickColor.new("Really Red")
wait(0.5)
CB.BrickColor = BrickColor.new("Really Blue")   
wait(0.5)
CB.BrickColor = BrickColor.new("Lime Green")
wait(0.5)
--You can use the color palette to find which colors suit what you want

You want to use BrickColor because that is the part's property for color.

BrickColor.new can also be constructed from a number value, but I usually use color names.

Hope this helped!

Ad

Answer this question