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

How can i change the color of a part depending on the value of a brickcolorvalue?

Lets say i have a model that has two children another model, and a brickcolor value but the model that is child the the original model contains a part. say the brickcolorvalue's value is set to Really red. how can i make the color of the part depending on the value of the brickcolorvalue via a script that is with the second model

im absolutely clueless on what to do but this is what i have tried

value = script.Parent.Parent.Value.Value

script.Parent.Part.BrickColor = BrickColor.new(value)

3 comments

0
  1. What you are doing with BrickColor.new, is basically doing Vector3.new(Vector3.new(1, 1, 1)). 2) That script would work perfectly fine.
0

but it doesnt

0

I don't understand can you screenshot your Workspace for that and tell us which Values you are using?

1 answer

value = script.Parent.Parent.PartColor.Value -- Changed the name because you used Value before the .Value, change the name

script.Parent.Part.BrickColor = value -- Since value is already a brick color, so, if we were to do the same method, but without the brick color value you would've done BrickColor.new(BrickColor.new("<color>"))

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