MouseButton1Click is only for GuiButtons. Not sure if Roblox replicates the event to the server but even if it does you should never detect it on the server.
The only way to Connect to a GuiButton event on the server is by accessing it through the player object. Which means you already know the player.
Example
-- Server Script
game.Players.thebeeninja5000.PlayerGui.ScreenGui.TextButton.MouseButton1Click:Connect()
-- here you already know the player who's PlayerGui you are accessing
That being said you should never run Gui code on the server in my opinion. The Gui is exclusive to the client and Roblox replicates it for some reason. But just because they replicate it doesn’t mean it’s good practice to edit it on the server.
What you do is you detect all Gui related things on the client and then send the information to the server with a RemoteEvent.