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
if you want to know how to do it with a normal script, here you go:
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | print (player.Name) |
3 | end ) |
I usually get usernames through this path:
1 | 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.
1 | Local name = game.Players.LocalPlayer.Name |