Hi, I'm trying to get the LocalPlayer's name for various things, and as a test I wanted to just print the value of their name. However, with the code I've got, nothing is happening when I run the game.
--ignore the stuff that's commented out below kthxbye local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer --local baseClaim = game:GetService("ReplicatedStorage").baseClaim function onPlayerAdded() local playerName = localPlayer.Name print(playerName) --baseClaim:FireServer() end Players.PlayerAdded:Connect(onPlayerAdded)
That's the code, it's within a LocalScript that is placed in a normal ScreenGui within StarterGui.
I'm getting no errors or anything from this script, it's just not printing anything.
Thanks for any help.
Client script:
String=Instance.New("String Value") String.Value = game.Players.LocalPlayer.Name print(String.Value)
If anything goes wrong let mde know and I'll see to it...