Trying to get a click work when holding a tool

Hi,
I am trying to make a system where you are holding a tool, and when you click that tool on a certain area, a function will start.

I’ve been looking through wikis, other topics here, and more, and I haven’t been able to figure out why the script isn’t working. As of right now, I have some scripts from other devforum topics in the script. Nothing’s working.

If I could get some assistance, that would be greatly appreciated.
Thanks.

What do you mean by a certain area? In a GUI, or on a physical part/area in the workspace.

I’ve got a physical part with the script I posted in it.

Here’s the thing, when holding a tool, you can’t click a normal click detector. That’s why I’ve got the parameters of a normal click detector when clicked with a tool instead of just mousebutton1click or something along those lines.

This is a duplicate question. See this solved (but unmarked) post. It does have what you are looking for: How can I make a player click on a ClickDetector while holding a Tool? - #2 by sloss2003 (post #2).

Thank you! I didn’t actually see that post while looking through here prior to this question