player = game.Players.LocalPlayer
tool = script.Parent
handle = tool.Handle
function onClicked()
handle.BrickColor = BrickColor.new("Bright red")
end
tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(onClicked)
end)
I have this so when I played clicks it changes the color of the handle, but how can I make it check what the player has clicked, like if onClicked.Name == "Dirt" then print("You clicked on dirt")

2 comments
That would not work because clicking ClickDetectors with a tool selected does not work.
^ yeah and it must be with a tool, cause im making a game kinda like minecraft, but you need a tool to mine the block