How do I make something flicker

I was bored and tried to make something flicker but only using code and I don’t know how to make something flicker with code .

Just make a timer (plenty of ways) and change this.transparency to either 0 (normal) or 1 (transparent)