Gui glitching, how do i fix it?

I have made it so when you hover over the gui, it changes the color, and when you click it, the gui dissapears, and it doesnt work and is glitching alot.
when i make a script for the gui to appear, it starts glitching, but when i just put the gui in starter gui and press play, the gui doesnt glitch… why is that? does anyone know how to fix it?


note: gui dissapears after certain amount of time

Are you using a TextLabel or a TextButton? If you use a TextButton the button will automatically change colors when you hover over it and with a button you could easily make it hide when you press it.