Can you get the player when he clicks a surfacegui.TextButton?
Not if it is in Workspace
In order to get the Player that is using a TextButton on a SurfaceGui, the SurfaceGui in question needs to be in the Player's PlayerGui and Adorned to the target surface. If the SurfaceGui is in the PlayerGui, you can use this little snippet to get the Player it's in automatically.
local player = script; repeat player = player.Parent until player.Parent = game.Players
That will result in player
automatically being the Player that the SurfaceGui is in.