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

How to make brick change to a custom color?

Asked by
snarns 25
6 years ago

I want to be able to change a brick color to a color of my choice, rather than Roblox's default colors. But I'm not sure how.

So how would I take something like this...

script.Parent.BrickColor = BrickColor.new("Really red")

and change it to something custom like ("90, 129, 255") ?

2 answers

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

poppeyhead's answer does WORK, but not the best. Color3.fromRGB() takes 3 args, R, G, and B. Each being a value from 0-255, eliminating the need to divide by 255.

0
You're right, I think I prefer this method. Thanks for you input :) snarns 25 — 6y
Ad
Log in to vote
1
Answered by
popeeyy 493 Moderation Voter
6 years ago

Instead of script.Parent.BrickColor = BrickColor.new("Really red") you would make BrickColor.new into Color3.new. Then you would get the Color not the BrickColor instead. Last, you would put your numbers out of 255. It would look something like this if you used that color you provided.

script.Parent.Color = Color3.new(90/255, 129/255, 255/255)

If you wanted to change the color change the number/255.

0
Right. Because ROBLOX recently added a Color option to parts, you are able to set a Color3 value to it. Mayk728 855 — 6y
0
Thank you very much! snarns 25 — 6y
0
You are correct, thank you GarryGecko99 30 — 5y

Answer this question