I understand you can do this all well and good with a ClickDetector but I want to do it with a SurfaceGui Button. All it should is print the Clickers name: It's a ServerScript inside of the SurfaceGui.
--doctorbenny2011 09/04/2016 Started 11:00GMT local a = script.Parent local Part = a.Parent local MainFrame = a.MainFrame local Close = MainFrame.Closed local Open = MainFrame.Open --SoundsStart local UG = Part.UserGranted local UD = Part.UserDenied local SU = Part.StartUp local SD = Part.ShutDown local DS = Part.DenyS local AS = Part.AcceptS local AG = Part.AccessGranted local AD = Part.AccessGranted --SoundsEnd -- THIS BIT \/\/\/\/\/\/ Close.Button.MouseButton1Down:connect(function(click) print(click.Name) end)
Actually Client to SurfaceGui is possible, just not through a ServerScript. What you will need is a LocalScript, the Brick where you want the Gui to appear with a unique name, and the Gui placed in StarterGui.
Within the LocalScript you would have to use the Adornee property of SurfaceGui in order to set the part the Gui should be showing on.
script.Parent.Adornee = game.Workspace.PartWithUniqueName
From there, since it looks like you have the bulk of your script set up, you can use the LocalPlayer value of Players to receive your player value. You can then send a signal to the server via RemoteEvent if you need the server to do something for you.