local name = game.Players.LocalPlayer.Name
script.Parent.SurfaceGui.TextLabel.Text = name
Theres something wrong with both lines. The first line got an error with no description and I put the second lines value to a string of random letters but it doesn’t work.
This is LocalPlayer on the sever. It’s nil.
This is LocalPlayer on a client. It changes per client to their player instance in the Players Service. It’s a ObjectValue too.
Both Server and Client can access their character as long as you have the player, or you can get the character and use GetPlayerFromCharacter() to access the player.