SurfaceGUI TextButton Not working

As the title says, the text button on my SurfaceGUI is not working, it means it can’t be clickable nor anything related to mouse, for example when MouseEnters.

Here is the part of the script:

local function Select()
	local Selection = script.Selection --Som que toca quando passar o mouse
	for _,v :TextButton in pairs(AU:GetChildren()) do --Loop For que percorre os objetos na Surface
		if not v:IsA("TextButton") then return end --Se não for um botão então não continua]
		local originalcolor = v.TextColor --Cor original do botão
		v.MouseEnter:Connect(function() --Quando o Mouse Entrar
			v.TextColor = Color3.fromRGB(255, 255, 0) --Muda a cor para amarelo
			Selection:Play() --E toca o Som anteriormente dito
		end)
		v.MouseLeave:Connect(function() --Quando o Mouse sair
			v.TextColor = originalcolor --Muda a cor para a padrão
		end)
		v.MouseButton1Click:Connect(function() --Quando o Mouse clicar
			print("You have clicked the button!") --Printa
		end)
	end
end

Select()

And it doesn’t work, both Mouse Enter and Mouse Leave and MouseButton1Click as well, I already tried to debbug, still nothing, any thoughts? Thank you!

Parent the SurfaceGui to StarterGui and set the Adornee to the original Part.

I already did this, still nothing.

Maybe do AU:GetDescendants()? I don’t know your layering. Does the print not work? Try to print at the top of the loop to see if it detects anything.

it starts stop to detect when it reaches local originalcolor = v.TextColor, but I already tried to make another Surface GUI and another part to addorne and it worked very well. Also AU:GetDescendants() wouldn’t work because it doesn’t have any descendant

the script comments seem to be in spanish(?) so I can’t read them.

either way this can be achieved by using a plugin called Tag Editor, simply install it and once on ROBLOX, go to Plugins tab and find Instance Tagging

Click on it and choose “Tag Window”
Then you will be met with this:
image
Once over here, add new tag by giving it a name, for example “textColorTag”

Now, inside the script you provided, delete everything and write this:

collection_serv = game:GetService( "CollectionService" )

for _, tag in pairs( collection_serv:GetTagged( "textColorTag" ) ) do 

tag.MouseEnter:Connect(function()

tag.TextColor = changed_color

end)

tag.MouseLeave:Connect(function()

tag.TextColor = original_color

end)

tag.MouseButton1Click:Connect(function()

print( "btn_click" )

end)

end

Now, go back to the Tag you created earlier and:

Make sure that while your object is selected, you check the box as shown in the screenshot.

You can now close the window and the script should work.

I don’t think this is the problem, I already tried to place a separated script without a for loop that runs and that still didn’t work. And the comments are Portuguese(Brazillian)…