Ad
Log in to vote
0

ScreenGui TextLabel isn't changing TextColor3 values correctly?

Asked by
Troidit 52
9 days ago
Edited 9 days ago

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.

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

1 answer

Log in to vote
1
Answered by
RubenKan 944
9 days ago

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.

0
Cool, thanks! Troidit 52 — 9d
Ad

Answer this question



Ad