Color3 is kinda like Vector3. You can't subtract a number from the set itself...
this.BackgroundColor3 = Color3.new(this.BackgroundColor3-1)
but you can subtract one from each element in the set...
original = this.BackgroundColor3
this.BackgroundColor3 = Color3.new(this.r - 1, this.g - 1, this.b - 1)
However, Color3 is a bit weird. In the properties window, the values of Color3 seem to be [255, 255, 255]. However, its true value is [1, 1, 1]. Thus, [0, 0, 0] is pitch black, and [1, 1, 1] is pure white. If we subtract 1 from the Color3 values, we're immediately going from white to black. To fix this, divide by 255:
original = this.BackgroundColor3
this.BackgroundColor3 = Color3.new(original.r - 1/255, original.g - 1/255, original.b - 1/255)
Full script:
local this = script.Parent
while wait() do
for a = 1, 70 do
local original = this.BackgroundColor3
this.BackgroundColor3 = Color3.new(original.r - 1/255, original.g - 1/255, original.b - 1/255)
wait()
end
end
1 comment
Thanks. ;D