hey i’m using click detectors to make it so if you hover over some specific items it will create a highlight in them and then of course disables it when you look away
the problem is tools, if you hover over something and equip a tool then look away, the highlight will stay there because MouseHoverLeave doesn’t trigger if you have a tool equipped
local Mouse = Player:GetMouse()
local CurrentlyHighlighting = nil
local Tag = "Highlightable"
Mouse:GetPropertyChangedSignal("Target"):Connect(function()
if CurrentlyHighlighting then
if CurrentlyHighlighting:HasTag(Tag) then
-- run highlight destroyer stuff
end
end
if Mouse.Target:HasTag(Tag) then
CurrentlyHighlighting = Mouse.Target
-- run highlight creation stuff
end
end)