good question, I didn't understand how this worked for awhile. That code uses "Instance.new()" to insert an int value into a game. This is the setup:
Instance.new(item being created , its parent)
In your case, it looks like the int value is being placed inside of player. I assume the like that connects to the function looks like:
game.Players.PlayerAdded:connect(PlayerAdded)
"Player" in this case is player who just joined, the part of them that is found in game.Players.(player's name)
since the intvalue is placed inside the player there, it will look like:
game.Players.(Player's name).leaderstats ---the next line changes its name to "leaderstats"
The next intvalue is placed inside stats which is the intvalue created right above.
To find these int values, you will have to start a test server with at least 1 player in studio mode and look in game.Players.Player1
1 comment
The first one is being sent to the specified player. The second one is being sent to that IntValue. A value object within a value object.