I was wondering how to smoothly fade out a block with the transparency value
this is my code so far
for i=1,10 -.1 do script.Parent.Transparency = (i) end
this instantly fades out the block when I run the game, is there any way to delay the counting so its slower and not instant?
You forgot to add a wait() into it so it would instantly fade, plus you didn’t put the right values on the loop for transparency, as it’s supposed to be 1,0 or 0,1.
Here’s a fixed version of your script :
for i = 0, 1, .1 do wait(.1) script.Parent.Transparency = i end
You can change the 0, 1 into 1, 0 if you want it to fade in. You can also change the wait() if you want it to fade faster or slower.
for i=.01, 1.01, .01 do script.Parent.Transpareny = (i) wait(.01) end
Change the wait function to a higher number like .02 if you wanted it to go faster.