# How can I use%?

0 favourites
• 3 posts
• I want to decrease and increase the variable by% attack. or% defense. I know it can be done like Choose (0,0,1) but this is very difficult. because my variable can be any number. is not automatically used as a percentage?

• Choose adds a random chance into the equation.

if you want to increase by percent you just have to express the percentage as a decimal, so 0.1 would be 10%, or 0.05 would be 5%.

multiply the current attack by the decimal to get the amount to add

PlayerAttack = PlayerAttack + 0.05 x PlayerAttack

would add 5% more attack to the current value.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Choose adds a random chance into the equation.

if you want to increase by percent you just have to express the percentage as a decimal, so 0.1 would be 10%, or 0.05 would be 5%.

multiply the current attack by the decimal to get the amount to add

PlayerAttack = PlayerAttack + 0.05 x PlayerAttack

would add 5% more attack to the current value.

I don't understand because my english is not good. is it possible to upload an image?

• 3 posts