Project 387: Lemonade Tycoon

9. Add +1 to your total lemons if you collect a lemon

Adding +1 to your lemons is a single line of code, but you'll also need another line of code to be able to access your lemons variable.
Starting point file for this challenge

Steps

1. Add +1 to your lemons

Adding to variables in Lua is a weird line of code - you have to set your variable equal to ITSELF, plus whatever you're adding. 

So, you have to set your lemons variable equal to itself PLUS 1. 
lemons.Value = lemons.Value +1

2. Access the lemons variable

We actually have to be more specific about this lemons variable. Remember, we made it in a different script, and Roblox needs help looking for it in that other script. 

The lemon is hiding in the leaderstats, which are hiding in the player. 

player.leaderstats.lemons.Value = player.leaderstats.lemons.Value +1

3. Create a local "player" variable

Okay, we unfortunately can't just write "player" - Roblox doesn't understand exactly what we mean by that. We have to tell it what player means. 

Create a new local variable called "player." 

local player

4. Define the "player" variable

You're going to set the "player" variable to long line of code. This line of code is asking Roblox to grab a player object from the character variable. 

(Character is the parent of the "other" thing that ran into your lemon.) 

game.Players:GetPlayerFromCharacter(character)