|
| 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 |
|
|
|
| 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 |
|
|
|
| 03 Nov 2013 04:49 AM |
| So this line names a function that is fired on player join? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 04:50 AM |
| and nP is the player that join |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
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 |
|
|