How to make animation stop on the last frame?

I’d like to make a switch turn from red to green when a player shoots it. I added animation to the switch so that the first frame is the switch as red and the second frame is the switch as green. How do I get it to stay green after the player shoots it?

Use goto on the animation, if the second frame is green, make the input have a value of 2