How can I make a player click on a ClickDetector while holding a Tool?

If you don’t know what I mean, I want to make it so when you click on and object with a click detector even if you are holding a tool. I cannot find this problem on the forums or on YouTube. Hopefully, there is a good explenation.

1 Like

You can do this on the client side using mouse.hit (Mouse | Documentation - Roblox Creator Hub) and checking if they hit a block that you want it to do something with. [this is only if you really can’t get it to work], and using Mouse | Documentation - Roblox Creator Hub to see if they are clicking.

Example:

local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer -- from a LocalScript
local mouse = localPlayer:GetMouse()

mouse.Button1Down:Connect(function()
	if mouse.Target == workspace.Baseplate then
		--do something
	end
end)
4 Likes

This question has been asked several times, including recently. Please search before posting threads.
https://devforum.roblox.com/search?q=clickdetector%20tool

i did search on the web. I guess i didn’t search up the problem properly

2 Likes