Select the detector object (object that sends the signal) in your node tree. Click on Node, and you will see the options Signals and Groups. Click Signals, and you will see the list of signals. Double click any of them to link it to your script.