what im trying to do with my script is that i want my brick's transparency to loop from 0 to 1 and goes back to 0 nonstop
i've tried several ways to code this but because i'm a beginner (started coding 1 week ago) i can't do it well
here is the latest one i tried
part = script.Parent
i = 0
while true do
i = i + 0.1
part.Transparency = i
wait(0.1)
if part.Transparency == 1 then
i = i + -0.1
part.Transparency = i
wait(0.1)
if part.Transparency == 0 then
i = i + 0.1
part.Transparency = i
wait(0.1)
end
end
end

3 comments
omg im so dumb i did try "for" but i stack them all together, i'm so happy now thanks alot
Nah, you're not. You had the right idea, just the logic was a bit flawed.
I updated the post to show what you could have done to make your way of doing it work