Hi,
I have a script that give coins and for example how to make it give 20% more of coins? Just say how i can get 20% of for example 420 coins?
Multiply by 1.2
that is all to it
2 Likes
i saw somewhere in devforum that users used “%” for something do you know what does this do?
That doesn’t do anything useful here. % is the modulus operator. Multiply by 1.2
100% = 1.0x
10% = 0.10x
1% = 0.01x
200% = 2.0x
2 Likes
This has already been said but you can simply multiple the figure by 1.2
In some circumstances, for example in accounting, you may wish to separate your additional figures from your main figure.
You can do so like this:
Score = 100
Bonus = Score * 0.2
Reward = Score + Bonus -- 100 + 20
Then if you want to do other things with your figures, for example, if the the player can lose points for messing up, your bonus remains consistent.
MessUps = 15
Loss = Score * (MessUps / 100) -- 15
Reward = Score - Loss + Bonus -- 100 - 15 + 20 = 105