I have a SurfaceGui with 3 buttons, all inside a frame. When I click them though, none of the code I have connected to the MouseButton1Click event fires. Here is the code I wrote for one of the buttons:
script.Parent.SurfaceGui.Main.btnLogout.MouseButton1Click:Connect(function()
print("Test")
screen.Main.Visible = false
screen.Login.Visible = true
screen.Login.TextLabel.Text = "Please tap your card to the reader below to begin."
machine.Credits.Value = 0
end)
No errors appear in the output console from any script, so I have no idea why it is not firing the event and running the code. Can anyone explain? This is running on a server script, inside the screen part.

4 comments
To clarify, the screen part is located in a model in the workspace.
Doest the test print?
It could be that you made the main screen part not visible
the test does not even print. That Logout button is to take you back to the login screen