Problem with button

Can someone tell me why it dont work?

Are you using a click detection extension? I don’t know how that extension works, but from what I understand both actions are executed at the same time. Have you tried changing the order of events? placing the one that includes the condition that the layer is visible above the one that includes the condition that the layer is not visible?Try this way, if now you have the problem when the layer is visible it is because the problem is this