This is not a LocalScript!
I used SurfaceGui on a part and added a text button. I thought getting the player from the character was going to be easy, but it turns out it doesn't work as ClickDetector does.
script.Parent.MouseButton1Click:Connect(function()
--how do you get the player from this?
end)
usually what I do is this,
script.Parent.ClickDetector.MouseClick:Connect(function(player)
game:GetService("Players"):GetPlayerFromCharacter(player)
end)
but in this case, it just printed nil

2 comments
There is not an current way without a localscript.
There is, the player is already the parameter, you don't have to get the player from the character, the player is the parameter.