I have a part in the workspace and then a surface gui in that part, and in that surface gui a frame, and in that frame a button, I have this script going so far but dont know how to get the player using this server sided script?
script.Parent.MouseButton1Click:connect(function() local player = game.Players.LocalPlayer
You should insert a local script in StarterGui which is the more efficient way to do this and inside the local script you can place this code
workspace.CustomizationGuiPart.SurfaceGui.Hats.Afro.MouseButton1Click:Connect(function() local Player = game.Players.LocalPlayer -- player print(Player.Name) end)