How to trigger script once? How can i limit the script trigger to once per pulse ex. i want to  sub  1 from INT from OBJ  once when BOOL is true and RAY(sensor) is generating true pulse(with OBJ detected via RAY).It just keeps subtracting 1 from INT every tick. I tried to give RAY false pulse mode, but when RAY is detecting OBJ and after 1 sec BOOL becomes True ,it wont work.
I have added another variable  to save the state and toggle it every time, 'Done' indicates whether you have subtracted or not during this pulse :

def main():
    cont = bge.logic.getCurrentController()
    own = cont.owner
    Ray = cont.sensors["Ray"]
    Bool = own["Bool"]
    Done = own["Done"]

    if Ray.positive and Bool and not Done:

        own["Done"] = True
        print("have nothing to do") 
    elif not Bool :
        own["Done"] = False

main()