Try defining the points outside of the function then as part of the class. I'm not sure if Unity puts limitations on the code it runs inside its scripts or not.
Also you should check if greater than or equal to 5 for the flash light. Since you don't cap how much points O will generate.
Code:using UnityEngine; using System.Collections; public class flashing : MonoBehaviour { private static int _points; void Update() { if (Input.GetKeyDown(KeyCode.O)) _points++; if (Input.GetKeyDown(KeyCode.F) && _points >= 5) { _points -= 5; light.enabled = !light.enabled; } } }