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

how do you change the value inside of a color3 value with a script?

Asked by
To0_ny 141
4 years ago

I tried to make it so the color3 value changes to the part's color, However, I just got a bunch of non-color3 values, what do I do

Script:

1local colorVal = script.Parent
2local part = script.Parent.Parent.Parent
3local partColor = part.Color
4colorVal = Color3.fromRGB(partColor)
5 
6print(colorVal)

1 answer

Log in to vote
1
Answered by 4 years ago

so i f i understand this correctly, you are trying to change colorVal's color to part's color, simple, you just need to assign the color3 value to it, which you didnt do, so here is your new code:

1local colorVal = script.Parent
2local part = script.Parent.Parent.Parent
3local partColor = part.Color
4colorVal.Color = Color3.fromRGB(partColor)
5 
6print(colorVal.Color)

since colorVal is script.Parent, it wont print a color3 value, you have to tell it to print the property, color3, from colorVal.\

hope this helps :3

Ad

Answer this question