Check colission within script

I have a small question.
I have a key-down event (Script Editor).
Now, within this script, there are certain parts that should ONLY be executed, if the object collides with a certain other object.
How can I find this out?
Thanks!
I have a key-down event (Script Editor).
Now, within this script, there are certain parts that should ONLY be executed, if the object collides with a certain other object.
How can I find this out?
Thanks!