✓ Accepted answer
Hey RobloxianDestroy,
You can easily get the Player's name if you simply use a LocalScript and make sure it's on the Client side. This means that the script's parent needs to be either of the following:
StarterGui
StarterPack
StarterPlayerScripts
StarterCharacterScripts
###Now then, after you have placed the LocalScript inside of the Client, you must access the player by using LocalPlayer. Like so:
####Example A
local player = game.Players.LocalPlayer;
###After you have done that, you just need to print the player's name inside of the function. Below is an example for this.
####Example B
local player = game.Players.LocalPlayer;
local uis = game:GetService("UserInputService");
uis.InputBegan:Connect(function(object, gp)
if object.KeyCode == Enum.KeyCode.Return and not gp then
print(player.Name);
end
end)
##Well, I hope I helped and have a wonderful day/night.
~~ KingLoneCat