Before anyone tells me yes this is a mapping related project so it belongs in nova If you've got any questions just ask down below
Lines of code are: When green flag clicked set ghost to 0/100 depending if the sprite is fading in or out at the time, wait 1 second, repeat x10 change ghost effect 10 or negative 10 if fading out. Different values could be used for longer fade period if the user prefers it.