i = 0 Base = game.Workspace.Baseplate Base.BrickColor = BrickColor.new("Really red") while true do wait(0.1) Base.Transparency = i i = i + 0.01 if i > 1 then i = i - 0.02 print(0) end end
i'm not sure how i can revert back my transparency after the baseplate goes to 1
Try putting a while loop in your if statement, cause right now, you're only telling it to subtract 0.02 from i only when i is greater than one. So when the while loop starts again, it would add 0.01 back to i, but that. So to fix that:
if i > 1 then while true do wait(0.01) i = i- 0.02 Base.Transparency = i if i < 0 then break end end
What you are doing is checking if the base plates transparency goes over one then -.02. But after that you add another .01 because its in a while loop. So it will be stuck at near 1. you have to make sure that the base plate goes back down to zero before it starts adding again.
i = 0 Base = game.Workspace.Baseplate Base.BrickColor = BrickColor.new("Really red") while true do wait(0.1) Base.Transparency = i i = i + 0.01 if i >= 1 then repeat i = i -.02 until i <= 0 print(0) end end