Hello all im trying to create a in-game shop.
However, I have encounter a weird problem,
I got this shop example from an old forum post.
Here's my problem,
I have a global variable called totalMoney which is basically the total coins the player has collected during playtime.
When you enter the shop with a totalMoney amount, example, System --> Start of layout --> System --> set TotalMoney to 10 and you try to buy
a item from the shop the bought and selected functionality works fine however, NO coin is deducted from the 'TotalMoney' global variable.
Here's an example where it does NOT work.
If you go to the event sheet and look for System-->TotalMoney > item_buy.price and delete "System --> Restart Layout"
you can see that now it starts deducting from the totalMoney but however the bought/selected functionality does NOT work.
But, if I go into the layout with totalMoney = 0 and somehow add coins inside the 'in-game' shop everything works fine.
I made an example of this:
Sorry if this is confusing,
English is not my first language and I tried my best to describe it properly.
If you can help me fix this will be great .
If there's an easier way to create a in-game shop please let me know or show me a capx file.