Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Color3.new not working in a for loop?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

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

Log in to vote
2
Answered by
Redbullusa 1580 Moderation Voter
9 years ago

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.

0
i feel dumbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb NotSoNorm 777 — 9y
0
It's Okkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Redbullusa 1580 — 9y
0
Comments need a character limit. Redbullusa 1580 — 9y
Ad

Answer this question