So I am making a part that has a color value and when the iteration of the for loop finishes it adds 10 to each value in the fromRGB() parentheses (or color code, don’t know what it is called). If i run the script it freezes my studio for 10 seconds and then nothing happens, the color does not change. Here is the script:
local ColorLooping = script.Parent
local ColorLoopingPartColor = Color3.fromRGB(100, 100, 100)
for start = 1, 10, 1 do
ColorLoopingPartColor = ColorLoopingPartColor + Color3.fromRGB(10, 10, 10)
wait(1)
end
local ColorLooping = script.Parent
local ColorLoopingPartColor = Color3.fromRGB(100, 100, 100)
local ColorLoopingPartColorAdd = Color3.fromRGB(10,10,10)
for start = 1, 10 do
local R,G,B = ColorLoopingPartColor.R, ColorLoopingPartColor.G, ColorLoopingPartColor.B
local A,B,C = ColorLoopingPartColorAdd.R, ColorLoopingPartColorAdd.G, ColorLoopingPartColorAdd.B
ColorLoopingPartColor = Color3.fromRGB(R+A,G+B,B+C)
wait(1)
end
local ColorLooping = script.Parent
local ColorLoopingPartColor = Color3.fromRGB(100, 100, 100)
local ColorLoopingPartColorAdd = Color3.fromRGB(10,10,10)
for start = 1, 10 do
local R,G,B = ColorLoopingPartColor.R, ColorLoopingPartColor.G, ColorLoopingPartColor.B
local A,B,C = ColorLoopingPartColorAdd.R, ColorLoopingPartColorAdd.G, ColorLoopingPartColorAdd.B
ColorLoopingPartColor = Color3.new(R+A,G+B,B+C)
wait(1)
end
Are you setting the part’s color atleast? If my script wouldn’t work, it would be black or white or any other color. Because it looks like the default color for a part
local ColorLooping = script.Parent
local ColorLoopingPartColor = Color3.fromRGB(100, 100, 100)
local ColorLoopingPartColorAdd = Color3.fromRGB(10,10,10)
for start = 1, 10 do
local R,G,B = ColorLoopingPartColor.R, ColorLoopingPartColor.G, ColorLoopingPartColor.B
local A,B,C = ColorLoopingPartColorAdd.R, ColorLoopingPartColorAdd.G, ColorLoopingPartColorAdd.B
ColorLoopingPartColor = Color3.new(R+A,G+B,B+C)
ColorLooping.Color = ColorLoopingPartColor
wait(1)
end
Now it works! So I guess in your script your just assigning each number in the fromRGB() to a variable and then update the variable to show the new color?