Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Getting player username using a script?

In my script, I need to get the player username in able for it to work. How would I get a player username using a script? And how do I apply the name, to like a variable? Ex:local Car = workspace.playersusernamesCar

2 answers

✓ Accepted answer

if you want to know how to do it with a normal script, here you go:

game.Players.PlayerAdded:Connect(function(player)
	print(player.Name)
end)

1 comment

0

/\ do this mine was probably with local scripts srry xd

I usually get usernames through this path:

game.Players.LocalPlayer.Name

It is much easier to do it through the Players thing rather than Workspace.

Once you get it through there, you can set a variable for it.

Local name = game.Players.LocalPlayer.Name

1 comment

0

This is for a local script right? I need it to work with a regular script.

This discussion is preserved as it was. New answers, comments, and votes are closed.