- 2

Help

Can you help me make this function work. Please text me if you have an idea what going wrong. var cows = 0; }); onEvent("cows", "click", function( ) { check(200, 2, "cows"); }); function check(cost, mult, x) { if (money >= cost) { x ++; money = money-cost; constante(mult, x); } }

27th Apr 2020, 6:55 AM
Hringo
 Hringo - avatar
1 Respuesta
+ 2
You posted half part code by that precitions of errors may not work.. But in your code, x is string and so x++ is not valid.. Where is money variable you initialized.. It may be mult not money.. Is it?
27th Apr 2020, 8:13 AM
Jayakrishna 🇮🇳