How come this doesn't work?

helpwithcode

#1

Okay, so I created a game where you farm corn, and you convert it to money to buy more plots and fertiliser, and the price of the fertiliser doubles once you buy it by tapping it. But it doesn't, yet the fertiliser's effect still happens. I tried increasing the price by the price, it doesn't work. I tried setting the price to a value that is 50 plus a value that increases by 50 when you get the fertiliser, plus the value, that doesn't work. There's a check once if for that to work, but there's nothing wrong with it. It's if money is bigger than price minus 1. Tell me why it doesn't work.
By the way, that's only for the problem, it's not explaining the game except for the first sentence. You drag a corn bag to a plot, wait for the corn to turn yellow, and drag a "blade" to it to harvest it. Here's the game: https://c.gethopscotch.com/p/xnfreobji


#2

plase post pic of code


#3


or


#4

on the second one have variable 3 first then 50 on the second circle then try


#5

Still doesn't work on the first buy, but works on the second, but not the third.


#6

did you have a number set for all of them at the beginning?


#7

No, only variable 1 as 50 and the rest aren't because I don't want the price not to be 50 at the beginning.


#8

try setting all the others to 0


#9

Still doesn't. 2020?


#10

Place a "set text" block on the bottom. Set the text to Variable 1.


#11

Variable 1 is the price, so it already is.


#12

Make it repeat forever. Add Variable 1 to the text field.


#13

It already has When 7=7, Set Text to Variable 1.


#14

If you want the price to double, have the code
When Fertilizer is tapped
Set value (Price*2)

That should double the price every time you tap the fertilizer.


#15

Nope, still doesn't.


#16

Is your price value set to 1 in the beginning? If it is set to 0 (which happens automatically) it can't double. I made a simple project doubling a value and it works.



#17

No, it's set to 50 at the beginning.


#18

I think it will work if you change the set value to 50 also


#19

Change it to what? Increase Variable 1 by 50 at the start or? (P.S. Increasing Variable 1 (the price) by 50 at the start doesn't work, I just tested it.)


#20

On @DragonLover975's first photo change the set value [price] to 1 to set value [price] to 50