This add’s the player’s rebirth value by a thousand and then divides it by the amount of rebirths the player multiplied by 6. ( It doesn’t increase the rebirths, just an algorithm )
Well I highly doubt that anyone would do that many rebirths at once, however under that case, you could use that script to log the price of each rebirth
Create a table,
Put something like this into the loop
table.insert(rebirthCostTable, rebirthCost)
Then you could call it, otherwise I would look into the algorithms that others have posted here
Why are you guys making it this complicated, just use a exponential scale. Any equation of the form y=n^x will work fine, where n is the steepness of the function and x would be the amount of rebirths which you can track by your own means. Using a for loop for any sort of math that isn’t integration(but even integration in most cases) is a massive sign you’re doing something terribly wrong.
This is exactly what arithmetic series sums do as I have said above. To get the price of x amount of rebirths it would be s(currentRebirths + x) - s(currentRebirths) where s is the sum function. Refer to my post above for code.