Project 387: Lemonade Tycoon

19. Program subtracting money

When you buy a lemonade stand, it should subtract the cost of the stand from your total coins.

Starting point file for this challenge

Steps

1. Subtract the cost from your coins

Subtracting from variables in Lua is a weird line of code - you have to set your variable equal to ITSELF, minus whatever you're subtracting. 

So, set your coins variable equal to itself MINUS the cost variable.
coins.Value = coins.Value - cost

2. Access the coins variable

Remember, we have to be specific about where the coins variable is. Take a look at your old code for an example. 

player.leaderstats.coins.Value = player.leaderstats.coins.Value - cost