Thanks to those who are being truly helpful. I have spent a long time writing this Script and I would nicely ask for those who are truly here to help . Thanks again!!
function findObject(instance,object,handle)
repeat wait() until instance
local itemDecendants = instance:GetDescendants()
for _,object in ipairs(itemDecendants) do
if (object:IsA(object) and object.Parent:IsA(instance.ClassName) and object:IsDescendantOf(instance)) and object.Name == handle then
print(object:GetFullName()); return object
end
end
end
local localPlayer = game:GetService("Players").LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:wait()
local cursor = localPlayer:GetMouse(); local cursorPoint = cursor.Target
local clickDetector
local checkForItem = true
local foundItem = false
local item_
local item
spawn(function()
while wait(.5) do
while (checkForItem) do
cursorPoint = cursor.Target
pcall(function()
print(cursorPoint)
if cursorPoint:IsA("BasePart") then --//Set to 'Tool'.
print("BasePart - '"..cursorPoint.Name.."'")
for _, descendant in ipairs(cursorPoint:GetDescendants()) do
if findObject(descendant, "BoolValue", "ItemTag") then print("foundItem")
item_ = cursorPoint.Name
item = workspace:WaitForChild(item_)
clickDetector = findObject(item, "ClickDetector", "ClickDetector")
foundItem = true
checkForItem = false
end
end
end
end)
wait(.5)
end
cursorPoint = cursor.Target
if item then
if (cursorPoint ~= item and checkForItem ~= true) then
item = nil
checkForItem = true
foundItem = false
end
end
end
end)
repeat wait() until foundItem
pcall(function()
clickDetector.MouseClick:Connect(function()
print("Hott")
end)
end)
If anyone cannot understand where I'm getting at here, please just tell me and I'll happily explain it like the helpful person I am

10 comments
so does it work?
Yes
I was just asking if anyone could nicely help me improve my work
...:wait() is deprecated. use ...:Wait() also while wait() do end is not a good way, use while true do wait() end
This question is primarily opinion based. It is up to whoever answers your question how to make it more efficient. They could be totally wrong.
I can tell for myself thank you, I don't care
Okay, I'll give that a spin
Your question could get closed.
Shhhh
no