generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: PlayerAdded workaround?

Previous Thread :: Next Thread 
navybofus is not online. navybofus
Joined: 07 May 2016
Total Posts: 5
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
TheIceZombieSlayer is not online. TheIceZombieSlayer
Joined: 26 Mar 2013
Total Posts: 267
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
navybofus is not online. navybofus
Joined: 07 May 2016
Total Posts: 5
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image