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
You have to add the SurfaceGui to their PlayerGui, then change the script to a local script