I am trying to make a pet multiplier for my clicking game, where when you equip a pet and click, it gives you more that just one click.
right now my script is:
ClickAmount * GamepassMultiplier * PetMultiplier
(ClickAmount = 1)
The GamepassMultiplier works but when I add the PetMultiplier it goes lower than one
I think it is because my multiplier for the pet is less than one (Eg: x0.05)
So what I’m asking is how do I calculate it so it gives a proper multiplier.
6 Likes
Hello, if u want to add multipliers lower than 1, you could add a simple math function that adds all the equiped pets multipliers + 1.
3 Likes
Yes, but what if the petmultiplier gets to say 2x, I don’t want to add one to the 2 because if I do then it would become 3x
3 Likes
would this work?
TotalMultiplier = GamepassMultiplier + (ClickAmount * PetMultiplier)
ClickAmount *= TotalMultiplier
1 Like
Don’t use multipliers lower than 1 then, 1.05x is better.
5 Likes
i’d agree but it’s not our game
2 Likes
I think I will do that, thank you for your help
3 Likes
If you really want to add multipliers like .05x, you can use this ecuation:
PetMultiplier = (ClickAmount * Gamepass) * PetMultiplier
Reward = ClickAmount * Gamepass + PetMultiplier
^^ I don’t know if it works
3 Likes
Thanks for that, it gave me a idea for how to make it work
2 Likes
Sorry for the late reply, but I was wondering, if I had four pets, with each a multiplier of x1.05, and I equip them, should PetMultiplier be x4.20 or x1.20?
2 Likes
My apologies, if you are using 1.05x, all the pets multiplier should be multiplied:
So if u have 2 pets with 1.1x multiplier it would result in a 1.21x multiplier.
2 Likes
So, how would I code it so it would subtract one from the right pets
2 Likes
Instead of using Pet1Mult + Pet2Mult you use Pet1Mult * Pet2Mult
2 Likes
sorry, I don’t think that would work, because 1.05 x 1.05 = 1.1025
which is higher than it should be.
2 Likes
It was an example of using 2 equiped pets with the same stats.
2 Likes
oh, sorry, I though you said “Pet1Mult * Pet2Mult” for the total
2 Likes
Do you have a idea on how to make it work?
1 Like
local CurrentMultiplier = 1
Create a table with the current equiped pets, loop thought every pet and multiply the PetStats to the CurrentMultiplier
CurrentMultiplier *= PetStats
At the end you should have the petMultiplier.
2 Likes
Again, you would have to create the PetTable in a modular system as you would have to add/remove the pets on equip/unequip
2 Likes
Sorry I am kind of confused, do I name the table PetStats
and then multiply it by CurrentMultiplier?
2 Likes