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

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

Asked by 4 years ago

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)
1
try using Color3.fromRGB proqrammed 285 — 4y
1
Color3s take numbers between 0 and 1, so either divide each number by 255, or use what ProqrammedGreen suggested. MegaManSam1 207 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

It was Color3.fromRGB

Ad

Answer this question