local player = game:GetService("Players")
local Lplayer = tostring(player.LocalPlayer)
print(Lplayer)
It dosen't print out the LocalPlayer's username. Help please!
local player = game:GetService("Players")
local Lplayer = tostring(player.LocalPlayer)
print(Lplayer)
It dosen't print out the LocalPlayer's username. Help please!
If this is via a Local Script, you can simply do
local player = game.Players.LocalPlayer
print(player.Name)
However if this is in a server script, I'm pretty sure you cannot do this. You can only get a player by using Events I believe. eg: A PlayerAdded event, etc.
local player = game.Players.LocalPlayer
print(player.Name)
It doesn't work.
Im getting "Players.6zk8.PlayerGui.ScreenGui.TextLabel.Script:4: attempt to index nil with 'Name"'
wait(0.5)
local plr = game.Players.LocalPlayer
print(plr.Name)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You don't need tostring before the localPlayer; it is already a string value