The reason is because you must have the Surface gui in the playerGui and have the adornee set to the part that you want the surface gui to be on. I believe it is safe to assume that you have the SurfaceGui in the part itself.
What you want to do is make sure the SurfaceGui parent is set to the player's playerGui. Like shown here (The starterGui, where it will end up in the playerGui)
Then, in your script. make sure the SurfaceGui's Adornee. Like shown here is set to the part that you want the surface gui to be shown on.
So you'll want your final code to look something like this:
1 | local screenGui = script.Parent |
2 | local button = screenGui.TextButton |
3 | local function OnButtonActivated() |
4 | print ( "Gui Authenticated!" ) |
7 | screenGui.Adornee = workspace.Part |
9 | button.Activated:Connect(OnButtonActivated) |
Hope this helps :)