How to make a "Buy Item Button"

Get help using Construct 2

Post » Wed Jul 31, 2013 11:56 am

My inventory has 3 slots. There is a shop in my game that sells items.

It works like this:

----------------------------
If [Buy Button] is clicked and [Money] is => 25 then sell one item to the player.
----------------------------

The problem is that when I click that button once, it sells 3 items at once (Inventory has 3 Slots)and fills inventory, plus takes money for 3 items instead of one.

How can I get ONE item only if I clicked [Buy] once?
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Wed Jul 31, 2013 12:07 pm

Try putting your transaction events into a sub-event with a trigger once condition:

If [buyButton] is clicked and [Money] is =>25
   
    -->[Trigger Once] : TRANSACTION EVENTS GO HERE
B
36
S
7
G
5
Posts: 322
Reputation: 8,780

Post » Wed Jul 31, 2013 12:10 pm

Yes, just figured it out! But thank you anyway! Sometimes when trying to think of many things at once, it confuses my brain and then even simple things disappear from my mind...
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Wed Jul 31, 2013 12:11 pm

Ah, it happens to all of us, at least you got it figured out ;)
B
36
S
7
G
5
Posts: 322
Reputation: 8,780


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests