Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why are these numerical color values not working even though BrickColor name values are?

So I'm using a script that changes a color value with the brick it touches, and it works when using the BrickColor.new("Really black")(or any color, as long as it's BrickColor.new(Color) format, but I can't seem to get numerical values to work with numerical values for BrickColor.new or Color3.new,

Color 3 Version:

if hitpart.Color3 ~= Color3.new(90, 76, 66) and hitpart.Color3 ~= Color3.new(45, 43, 41)
then 
	hitpart.Color3 = Color3.new(128, 187, 219)

BrickColor Version:

 if hitpart.BrickColor ~= BrickColor.new(90, 76, 66) and hitpart.BrickColor ~= BrickColor.new(45, 43, 41)
then 
	hitpart.BrickColor = BrickColor.new(128, 187, 219)

2 comments

1

try using Color3.fromRGB

1

Color3s take numbers between 0 and 1, so either divide each number by 255, or use what ProqrammedGreen suggested.

1 answer

ProgrammedGreen was right, I would mark his comment as correct if I could.

It was Color3.fromRGB

This discussion is preserved as it was. New answers, comments, and votes are closed.