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

Why is this loop counting down instead of counting up?

I have a text label that I want to slowly appear but instead its just there and fades away.

By my understanding this should count up. No where in the script does tew called except for in this loop. So I dont get why its fading instead of appearing. What could be causing this?

for t = 0, 1, 0.1 do
	tew.TextTransparency = t
	wait(0.1)
end

2 answers

✓ Accepted answer

Simple problem: the higher the transparency is (aka the closer it is to 1), the more transparent it makes the part. So, setting the transparency to 1 means that it's 100% transparent (completely invisible), while setting the transparency to 0 means that it's 0% transparent, (completely opaque). So, to fix this, you can start the loop at 1 and end at 0, decreasing by 0.1 every iteration:

for t = 1,0,-0.1 do
	script.Parent.Transparency = t
	wait()
end

2 comments

0

u helped me breathe

0

i just realized I was thinking about it backwards. Thank you very much.

It is because you are doing it wrong

4 comments

0

How should I be doing it?

0

I do not know you should be doing it correctly maybe the numbers things are wrong I am not sure

0

you could have made this a comment..

0

What do you mean!

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