I forgot how to fade something using a for loop, any help?
This is the code I have so far.
1 | while true do |
2 | wait() |
3 | for i = 1 , 10 do |
4 | wait() |
5 | script.Parent.Tex.Transparency = script.Parent.Tex.Transparency/i |
6 | print (script.Parent.Tex.Transparency) |
7 | end |
8 | end |
The way you're changing the transparency doesn't make the most sense.
The most reasonable way to fade something from 1 to 0 in 10 steps takes these values:
What you're doing is... very strange?
Notice that each step just decreases it by 0.1
. Do that!
1 | script.Parent.Tex.Transparency = script.Parent.Tex.Transparency - 0.1 |