Shoot laser pointer at target

You shoot a regular laser pointer at the photoresistor when the light is green. (The yellow light also comes on right before green is about to go off as a warning.) If you shoot it while the light is red, you loose (code runs loose function). 

 

The photoresistor is also put in a black paper cone to reduce the regular light. 

 

The problem is that it somehow gets to the loose function even when the light is green, which I dont understand.

 

*the photos of the code included have been edited a little but it should just explain it

 

 

Thank you for helping me!

Fiona