How to click a Clickdetector with tools?

well, I’ve been looking at how to make a click detector clickable with a tool but it doesn’t really give me any option for that, when trying to click with the tool neither does the script run so I don’t know what interferes with that (I already tried without the tool)

3 Likes

Add a Boolean value, that checks when the player has that tool equipped, into the player and when they click on the button check that value

6 Likes

If you want the click detector to show the normal mouse icon when the tools not equipped you can check the value and change the hover icons if they are hovering with the tool

4 Likes

Maybe this topic can help you:

3 Likes

You can check if the player is holding the tool.

local ClickDetector = script.Parent
local ToolName = "RocketLauncher"

ClickDetector.MouseClick:Connect(function(plr)
	if plr and plr.Character and plr.Character:FindFirstChild(ToolName) then
		-- whatever you want to happen here
	end
end)

This goes in a ServerScript and it needs to be a child of the ClickDetector. If you need it to be somewhere else then you can adjust the script.

2 Likes