I have an Javascript array object:
Code: Select all
Game.UsersItems = {itemAutoClickers: [0], itemClickingTeam: [0]};
Which stores the users items and if they buy an "itemAutoClickers" then that value will increment with the following code:
Code: Select all
Game.UsersItems.itemAutoClickers[0]++;
However all this works but that specific item (itemAutoClickers) should give the user 1 score each time. but for some reason it gives them 2. I decided to do the following:
Code: Select all
console.log(Game.UsersItems.itemAutoClickers);
It displays:
[0]
[0]
So I was wondering if you have any ideas why the code won't work as intended?
Just to show you the log output:
Error PC.png