I can't seem to change the color of a part with the color3 script using a color3value/str value

image
I have been scripting lately and I have been trying to change a color of a part with a Value, but I can’t seem to get it to work, the color simply goes black, and if I change the value to 1 it goes red

I have shortened the script so you can read the important part right away:

part = script.Parent.Part -- variable


part.Color = Color3.new(script.Parent.Value.Value) -- changes the color using color3

Things I have tried:
If I use a Color3Value the color simply goes black
If I use a string value the color is black
If I use a string value and it’s value is 1 then the color goes red ahem r g b

So my question is: how to be able to change the color to (209,32,90) with a Color3Value.

2 Likes

What you need is;

part.Color = Color3.fromRGB(209,32,90)  or part.Color = Color3.fromRGB(script.Parent.Value.Value) 

Is the value a Color3 Value? (And not a string?)

Well, I’m using both of them and they both don’t work, is this script for a string value? And your script does not work

Is the value above the part a string value or a color3 value?

1 Like

color3value, but not just that. there’s an error in your script, which is:
Workspace.Script:4: Expected identifier when parsing expression, got ‘=’

I haven’t really worked with or statements so I have no idea whats happening right now

Sorry. I meant that you could use the part after the or as well.
Basically;

part.Color = Color3.fromRGB(209,32,90)

or

part.Color = Color3.fromRGB(script.Parent.Value.Value)

So basically I only can go with option 2 because I want to change the color sometimes (any random color) but that doesn’t work, and the first option isn’t what I can do in this position sadly

(Option 2 makes the part go black)

Right. Can you click on the value and show me its properties?

1 Like

image
Here you go, there are the properties of the requested value

Just rename the value to something other than ‘value’, this is a redundancy that confuses the interpreter. You also want to set up the code like this

part.Color = script.Parent["VALUE NAME"].Value -- changes the color using color3
1 Like

Didn’t know that changed anything. I guess you can try above.

1 Like

Thank you! this seems to be the fix for today!

2 Likes

Glad to help! Happy developing friend!

1 Like

Thank you for trying to help me out, we’ve found a fix, have a great one!