Having trouble with my in-game shop

I’ve been trying to make a simplistic shop in my game, and the purchase function works, but I’m having a lot of trouble with the global bricks. Whenever I purchase one of the items, and then try to purchase the other one after, instead of subtracting, the coins/stars counter goes up by 3, no matter what item I purchase first. Here is the link to my game, the problems are on the second to last level. Edit: There is also a new problem of the roller skates not being able to be bought, despite none of the code being changed.
https://flowlab.io/games/play/2479511


You need to connect the global going into A to the switch through the “get” input.

1 Like

I just tested it, It didn’t work though I could’ve gone something wrong. Instead of subtracting the coins went up


To fix the roller skate do this with the expression. You need to make it save if you got it to.
If you need an example of what to do for a shop here’s a link to one of my games.

1 Like

It didn’t save the stars I got. Wait… are stars and coins different?
You might need to use some save functions in there too instead of only globals.

That’s a pretty fun platformer. I like the art and the fun but basic gameplay.

1 Like

they’re the same, I use the words interchangeably, I should’ve said that. And I don’t know how that would happen, did they reset when you went back from the editor? I can try to fix that if possible as well. Also how would the save functions work there? Would it be for the stars specifically?

1 Like

I played through the whole game and then got to the shop and when I clicked on it it just doubled the value??? I think you should tag (ex. @Coofin) some other flowlabber that could handle this. Maybe like CodeAlpaca or someone idk.

1 Like

Ok, I’ll tag someone, thank you so much for the help as well. @CodeAlpaca