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: