How to make a player be able to buy something with a custom currency?

But the players presses a button(game overlay) and then they get a click.

Just wire a button to the game overlay!

No but the options for the button are deactivate button or activate button.

Just use a trigger to run the following code:

If (clicks >= [enter min amount])
   | set property { "clicks"
   | value        { get property "clicks" - [min amount]
   | broadcast message on channel { "clickpass"

I hope that makes sense!

2 Likes

@Here_to_help I have a problem. The value of the clicks stays the same it doesn’t subtract.

I think it doesn’t work because of the counter.

I think you have to wire it to something that will subtract the value given (when receiving on clickpass).

No but the counter is wired to the property. So when the counter decreases the property decreases. But when the property decreases the counter doesn’t.

Hmmm it worked for somebody else I helped but if you think it’s the counter that’s not working, then you can just replace that with a trigger that sets the property equal to the property + 1. Also could I see the block code you recreated?

1 Like

Yes, you can see the block code. Thanks for the help.

No I was asking you to see the screenshots of the block code haha, also did you try replacing the counter like I told you?

1 Like

Not yet, haha.

Now I got the trigger working. Let me try the block code.

@Here_to_help The block code you showed doesn’t work for me. It doesn’t subtract the amount of clicks. On game overlay the amount is the same before I triggered the trigger.

Question

Do you need the block code I recreated? Or something like that?

Yes, I’m asking to see the block code you recreated.
Also, on the channel broadcasting from the blocks (“clickpass” in my example), make sure that the game overlay updates on that channel.

Triggers block code:

No, I’m asking for your recreating of the code in this post:

This is the code that subtracts your clicks when you buy something.

Sorry, T-T. Here you go:

1 Like

Huh, that’s odd. Are you sure your game overlay is updating after that subtraction (that’s why I had the “clickpass” channel), and did you delete the counter or at least remove the property from it once you replaced that system with the trigger?

1 Like

Why is the title of the post different to the actual post :victory_hand: :wilted_flower::sob:
Answer to the title: Vending machine.
The Cllicks thing?
Yep I think @some_kid is fit for this gimgineer problem.

Edit: See that? Right there? That’s why I called some kid.