Hello, I was having an issue with this local script, that changes a textlabel’s text whenever an object with a clickDetector that has a specific CollectionService tag is hovered over with the mouse.
As explained in the title, the event doesn’t seem to be firing at all
local cs = game:GetService("CollectionService")
local textboxes = require(game.ReplicatedStorage:WaitForChild("TextBoxModule"))
local Tooltip = textboxes:Activate(game.Players.LocalPlayer.PlayerGui:WaitForChild("Dialogue").ItemTooltip)
local function AddClickConnection(detector : ClickDetector)
detector.MouseHoverEnter:Connect(function()
print("Mouse Entered")
Tooltip:AddSentences(detector.Parent.Name , 0)
end)
detector.MouseHoverLeave:Connect(function()
Tooltip:AddSentences("" , 0)
end)
end
for i , v in pairs(cs:GetTagged("Clickable")) do
print(v.Parent)
AddClickConnection(v)
end
cs:GetInstanceAddedSignal("Clickable"):Connect(function(Object)
AddClickConnection(Object)
end)