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

How do you solve this?

Asked by
Relhem 5
8 years ago

This wont work

Brick = game.Workspace.Brick

function onTouch() Brick.BrickColor = Dark green wait(3) Brick.BrickColor = Baby Blue end script.Parent.Touched:connect(onTouch)

Can you guys help me, I don't know how to solve this.

0
It still doesn't work, I copy your work from first to end checking over all details and it still doesn't work. I even try doing local script and regular script pasting in my brick in workspace over and over. Relhem 5 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

You're using BrickColor Wrong

How to change the Color of a Brick,

To do this, all you have to do is use BrickColor.new(), like so,

local brick = game.Workspace.Brick

function onTouch() 
    Brick.BrickColor = BrickColor.new("Dark green")
    wait(3) 
    Brick.BrickColor = BrickColor.new("Cyan")
end 
script.Parent.Touched:connect(onTouch)
I wasn't sure if Baby blue was a color code so I changed it. It might be. You can of course change the color name if you wanted to.

Here's a link to some Color Codes.

Here's also a link to the wiki on BrickColor.

Alternatively,

You could use a Color3 value as well, if you wanted to. To do this all you would have to do it use a color3 inside of the BrickColor, like so,

local brick = game.Workspace.Brick

function onTouch() 
    Brick.BrickColor = BrickColor.new(Color3.new(1,1,1))--White
    wait(3) 
    Brick.BrickColor = BrickColor.new(Color3.new(255,0,0))--red
end 
script.Parent.Touched:connect(onTouch)
If you wanted to use this method, you could look through the color codes and change the color very easily, with more control.

I hope I helped!

Good Luck!

If I helped, don't forget to click the accept button below my name next to my answer, it helps a lot.
Ad

Answer this question