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
3 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:

local colorVal = script.Parent
local part = script.Parent.Parent.Parent
local partColor = part.Color
colorVal = Color3.fromRGB(partColor)

print(colorVal)

1 answer

Log in to vote
1
Answered by 3 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:

local colorVal = script.Parent
local part = script.Parent.Parent.Parent
local partColor = part.Color
colorVal.Color = Color3.fromRGB(partColor)

print(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