Money System Only Goes Up Once

Get help using Construct 2

Post » Fri Mar 20, 2015 5:49 am

At first, my money system was working fine. In my drag racing game, every race, if the player wins add 250 to the money, and add 85 if they lose. Then i added the Webstorage and now the money will only go up after one race. If I try it again, the money won't go up any more.

On start of layout:
WebStorage.LocalValue("TotalMoney") > 0: Set Money to WebStorage.LocalValue("TotalMoney")

Every tick: GoldText: Set text to "" & Money

Money not equal to WebStorage.LocalValue("TotalMoney"): WebStorage: Set Local Key "TotalMoney" to Money
B
12
S
3
Posts: 129
Reputation: 1,131

Post » Fri Mar 20, 2015 8:05 am

When you are comparing it / adding / subtracting, make sure to convert it to an int() or float() first
B
32
S
7
G
2
Posts: 317
Reputation: 2,851

Post » Sat Mar 21, 2015 2:10 am

So like this? int(WebStorage.LocalValue("TotalMoney)) I added this to all the events and it still does the same thing.
B
12
S
3
Posts: 129
Reputation: 1,131

Post » Sat Mar 21, 2015 9:01 pm

?
B
12
S
3
Posts: 129
Reputation: 1,131

Post » Sun Mar 22, 2015 2:08 am

bump
B
12
S
3
Posts: 129
Reputation: 1,131


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948, Yahoo [Bot] and 5 guests