Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

ScreenGui TextLabel isn't changing TextColor3 values correctly?

I'm trying to make the text in my ScreenGui glow faintly from different shades of yellow. I thought this script might be able to do that. But when I test in game, it's changing the text color values to RIDICULOUS numbers like 572712,1958123,498281 (just an example)

local txt = script.Parent

while true do
	for i=125,200, 1 do
		print(i) --just to see what's going on
		txt.TextColor3 = Color3.new(224,224,i)
		wait(0.5)	
	end
	for i=200,125, -1 do
		txt.TextColor3 = Color3.new(224,224,i)
		print(i) --just to see what's going on
		wait(.5)
	end
end

am I using an incorrect or terrible method for what I'm trying to achieve. Is there a better way then what I'm doing right now? Because what I'm trying right now isn't working.

1 answer

✓ Accepted answer

This is because color3.new() uses values from 0 to 1. You can either:

Color3.new(224/255,224/255,i/255)

But roblox released a new thing

Color3.fromRGB(244,244,i)

wich will automaticly do this for you.

1 comment

0

Cool, thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.