F
F
flanyaa2021-06-08 15:41:00
C++ / C#
flanyaa, 2021-06-08 15:41:00

How can I add one value to a variable?

public void OnClickBuy()
    {
        if(Money >= 100)
        {
            MoneyUp *= 2;
            Money -= 100;
            Repairs = 2;
        }

For example, how can I make it so that after clicking on the button, the value 1 is added to the "repair" variable?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2021-06-08
@flanyaa

after pressing the button, the value 1 was added to the "repair" variable

Repairs = Repairs + 1

I
itgood, 2021-06-09
@itgood

Repairs++;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question