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

Color3.new not working in a for loop?

This loop should subtract one off the r value, but it's not, It just makes it yellow and breaks

	for i = 255,0,-1 do
		script.Parent.TextColor3 = Color3.new(i,255,0)
		wait(.1)
	end

1 answer

✓ Accepted answer

Try this instead.

for i = 255,0,-1 do
    script.Parent.TextColor3 = Color3.new(i/255, 1, 0) -- 255/255 == 1
    wait(.1)
end

Color3 constituents uses numbers from 0 to 1 and anything in between. That's why I divided i by 255.

3 comments

0

i feel dumbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

0

It's Okkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

0

Comments need a character limit.

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