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
Closed as Primarily Opinion-Based by User#24403, Gey4Jesus69, lunatic5, zblox164, SummerEquinox, and yHasteeD
This question has been closed because it is a discussion about a topic focused on diverse opinions, which isn't a good fit for our Q&A format.
Why was this question closed?