Collectionservice on textbutton text not working

Hello, I am trying to achieve a local script using collectionservice to search for textbuttons with the tag Hover and when you hover them they would get a little arrow in front of the original text

Also, the script is placed in StarterPlayerScripts

Not sure what the issue could be, I tried re writing the script and it still didn t work

There s nothing much left to say so i ll just leave the script:

local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")

local function AddHoverEffect(button)
	local originalText = button.Text

	button.MouseEnter:Connect(function()
		button.Text = ">" .. originalText
	end)

	button.MouseLeave:Connect(function()
		button.Text = originalText
	end)
end

local function SearchAndTag()
	local taggedButtons = CollectionService:GetTagged("Hover")

	for _, player in pairs(Players:GetPlayers()) do
		for _, button in pairs(taggedButtons) do
			AddHoverEffect(button)
		end
	end
end

SearchAndTag()

Players.PlayerAdded:Connect(function(player)
	SearchAndTag()
end)

Not sure if it helps but i ll leave this here too:
image

By the looks of it in the second image you have the script disabled, you can enable it just by clicking on it and changing the Disabled property in the explorer.

Hello, i mentioned that the script is located in StarterPlayerScripts, sorry if i caused some confusion.

Note: This is another version of the script, if it helps in any way

local CollectionService = game:GetService("CollectionService")

local function AddHoverEffect(button)
	local originalText = button.Text

	local function OnMouseEnter()
		button.Text = ">" .. originalText
	end

	local function OnMouseLeave()
		button.Text = originalText
	end

	button.MouseEnter:Connect(OnMouseEnter)
	button.MouseLeave:Connect(OnMouseLeave)
end

local taggedButtons = CollectionService:GetTagged("Hover")

for _, button in ipairs(taggedButtons) do
	AddHoverEffect(button)
end