Sorry I should've put it more clearly:

Do you accidently execute your flashlight function multiple times?

It happens if you use something like this for example:
Code:
while(1)
{
   if(key_a)
      do_something();
   
   wait(1);
}


If you hold [A] for 10 frames the function gets called 10 times.
So, if that's the same as your case, you have to make sure that the function gets called only once.

You could assign a fuction to a key and use a toggle var.
Let me know if you need an example.

Last edited by Kartoffel; 04/04/15 11:28.

POTATO-MAN saves the day! - Random