Events key for Script

Hi :smiley:

Currently I am working on this script:

from bge import logic 
cont = logic.getCurrentController()
own = cont.owner
scena = logic.getCurrentScene()
lista_obj = scena.objects
sensor = cont.sensors['Near']
zaczep = sensor.hitObject
naczep = own
own = cont.owner


naczep.position = zaczep.position

The script is reacting only when sensor Near is detected object. But I want add one more sensor for react the script (keyboard T). Unfortunately this is not working. I don’t want this react until T key is pusched. How I can repair that??

>File<

Sorry for my English :frowning:

adding the sensor


keyboard = cont.sensors["Keyboard"]
near = cont.sensors["Near"]

if keyboard.positive and near.positive:
    #dostuff

Thanks a lot agoose77 :smiley: