How to make it where you can use click detectector with a gear

Click Detectors do not work when you are holding a gear…If anyone can show me how to properly format it so I can cut down a tree with an axe that would be much appreciated…
I wanna make it so you can click the tree trunk and then it will see if you are holding an axe and if you are it will let you have it…

please dont spend too much time giving an answer i think i can figure it out if you point me in the right direction…Thanks

This is a click detector in a part…