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 » Scripting Helpers
Home Search
 

Re: What is this?

Previous Thread :: Next Thread 
AlphaBlack201 is not online. AlphaBlack201
Joined: 01 Jun 2013
Total Posts: 118
03 Nov 2013 04:38 AM
game.Players.PlayerAdded:connect(function(nP)


What I understand: Please correct if anything is wrong

game.Players-
The players inside of the game

PlayerAdded-
When a player joins

What I think this is-- game.Players.PlayerAdded:connect(function(nP)

It creates a function on playerJoin
Function called 'nP'
--------------------

I'm just not sure WHAT exactly the function does.
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
03 Nov 2013 04:43 AM
What you're looking at is a connection line. Each object has events. Events will fire when something specific happens. The Players service, has an event called PlayerAdded, and this event returns the player that was added. :connect() is well, connect to a function, this case, an anonymous function. The function takes an argument, which could be named anything by the way. Call it, nP. Which is the new player that was added. Go to the wiki. You have a lot to learn.
Report Abuse
AlphaBlack201 is not online. AlphaBlack201
Joined: 01 Jun 2013
Total Posts: 118
03 Nov 2013 04:49 AM
So this line names a function that is fired on player join?
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
03 Nov 2013 04:50 AM
and nP is the player that join
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
03 Nov 2013 04:50 AM
Yes. This line calls a function, an anonymous function, which means it could be used once unless if something returns it.
Report Abuse
AlphaBlack201 is not online. AlphaBlack201
Joined: 01 Jun 2013
Total Posts: 118
03 Nov 2013 04:57 AM
So when used with

if nP.Name == v then

It's a player "Verification" or player check, correct?
Report Abuse
AlphaBlack201 is not online. AlphaBlack201
Joined: 01 Jun 2013
Total Posts: 118
03 Nov 2013 05:22 AM
Bump'd
Report Abuse
AlphaBlack201 is not online. AlphaBlack201
Joined: 01 Jun 2013
Total Posts: 118
03 Nov 2013 05:42 AM
Bump Bump'd
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
03 Nov 2013 05:44 AM
Here's the wiki article regarding the event PlayerAdded.

http://wiki.roblox.com/index.php/PlayerAdded_(Event)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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