I'm attempting to gradually change a button from dark grey to bright green (and its text from dark green to white) to signify it can be clicked! When I test this simple repeat loop out, it instantly turns black with no delay. I've noticed that the r, g, and b values of Color3 are from 0 to 1 and accounted for that, but that's all I've been able to do to attempt to debug this problem. Can anyone help me?

--Starting out, the image color is (95, 95, 95) and the text color is (130, 130, 130)
repeat
	if okay.ImageColor3.g < 1 then
		okay.ImageColor3 = Color3.fromRGB(okay.ImageColor3.r, okay.ImageColor3.g + 5, okay.ImageColor3.b)
	end
	if okay.ImageColor3.b < 65/255 then
		okay.ImageColor3 = Color3.fromRGB(okay.ImageColor3.r, okay.ImageColor3.g, okay.ImageColor3.b + 5)
	end
	if okay.ImageColor3.r > 0 then
		okay.ImageColor3 = Color3.fromRGB(okay.ImageColor3.r - 5, okay.ImageColor3.g, okay.ImageColor3.b)
	end
	if button.TextColor3.r < 1 then
		button.TextColor3 = Color3.fromRGB(button.TextColor3.r + 5, button.TextColor3.g + 5, button.TextColor3.b + 5)
	end
	wait(.01)
until okay.ImageColor3.g == 1 and okay.ImageColor3.b == 65/255 and button.TextColor3.r == 1
--By the end, the image color should be (0, 255, 65) and the text color should be (255, 255, 255)

2 comments

0

I know nothing about this but maybe renderstepped could work? (or maybe not)

0

Renderstepped has more to do with frame rates than changing a button to the color green