I am trying to make a rebirth system that I have thought out in my head. I want the price to increase like this:
1 rebirth * starting amount (5,000,000) = 5,000,000
2 rebirths * the required amount for the first rebirth (5,000,000) = 10,000,000
3 rebirths * the required amount for the second rebirth (10,000,000) = 30,000,000
and so on.
I’m having trouble coming up with an equation that matches this. Please reply if you know how to do this.
You could use a module script to hold the value, which is set to the starting amount when the player joins the game. The value could then be updated by the function I specified when the player rebirths. e.g:
local moduleScript = require(someModulePathway)
local currentValueTable = moduleScript.someModulePathway
local currentValue = currentValueTable["currentValue"]
---an event that triggers the rebirth
currentValueTable["currentValue"] = rebirthMath(currentValue, rebirths)