Trying to print the LocalPlayer's name doesn't do anything? (it's in a local script btw)
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.
03 | local Players = game:GetService( "Players" ) |
04 | local localPlayer = Players.LocalPlayer |
07 | function onPlayerAdded() |
08 | local playerName = localPlayer.Name |
15 | 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.