|
| 06 Aug 2016 12:08 AM |
| Hello all, I've been scripting in Lua for Roblox a couple of days now, but I've hit the same issue over and over. Why does PlayerAdded print the generic Player1? Is this only a testing issue? Is there a workaround? Any help would be greatly appreciated. |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2016 12:14 AM |
| You could do game.Players.ChildAdded, Player1 has been the default testing player for quite a while, from what I'm aware of, you can't change the username unless you go test > start player twice |
|
|
| Report Abuse |
|
|
Nitro509
|
  |
| Joined: 27 Jun 2010 |
| Total Posts: 11170 |
|
|
| 06 Aug 2016 12:16 AM |
This is probably what you're referring to:
game.Players.PlayerAdded:connect(function(Player) print (Player) end)
instead,
game.Players.PlayerAdded:connect(function(Player) print (Player.Name) end)
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 06 Aug 2016 12:18 AM |
game.Players.PlayerAdded:connect(function(p) wait() print(p.Name) end)
It's just a small thing since studio is now simulating as if you are your actual character, so it takes that fraction of a second to load. This should print your real name. You won't run into that problem in an online game though. |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 06 Aug 2016 12:19 AM |
| No @nitro, it's a studio thing now that they made it so you play as your signed in character when using play solo in studio. |
|
|
| Report Abuse |
|
|
Nitro509
|
  |
| Joined: 27 Jun 2010 |
| Total Posts: 11170 |
|
|
| 06 Aug 2016 12:20 AM |
game.Players.PlayerAdded:connect(function(Player) print (Player) end)
returns "Player1".
|
|
|
| Report Abuse |
|
|
|
| 06 Aug 2016 01:54 AM |
| Thanks everyone, I had finally started to toy around with wait() to see if it would work. Everything looks good to go now :) |
|
|
| Report Abuse |
|
|