I'm making a dancefloor with Surfacegui's, the surfacesgui takes the color from a color3 value, But when I change the Color3 value in the code the surfacegui do not change, the value does, but the surfacegui don't. Can you help me?
local Color = script.Parent.Color.Value local Part = script.Parent.Parts["1"].SurfaceGui Part.Frame.BackgroundColor3 = (Color) wait(2) script.Parent.Color.Value = Color3.new(161/255, 161/255, 161/255) Part.Frame.BackgroundColor3 = (Color)
The script is taking the initial value of the ColorValue object. So say the ColorValue's Value was Color3.new(1,.5,0) then the script will remember that for whenever you use the value. It won't change unless you redefine "Color".
You probably do not need the Color3Value. Just set the BackgroundColor3 properties directly to the Color3 values. However, for the script, I will adjust to what you need to do.
local Color = script.Parent.Color --Just remove .Value from here. .Value is telling the script hey remember the Color3 Value, not the Color3Value object. local Part = script.Parent.Parts["1"].SurfaceGui Part.Frame.BackgroundColor3 = (Color.Value) --Since Color is the object, we want the Value. wait(2) script.Parent.Color.Value = Color3.new(161/255, 161/255, 161/255) Part.Frame.BackgroundColor3 = (Color.Value) --Since you changed the Color's value and this is the color object, we want the Value.