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!
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
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)…