Hello! I would like to make a rebirth system for my game but I don’t know how to calculate the after-rebirth price while not rebirthing for huge amounts.
Let me explain. Okay, so, you have 1 rebirth. Each rebirth costs your actual rebirth * 10k in this case. So, if you had 2 rebirths, it would cost 20k, 3 rebirths-30k etc.
Now, what I want is to make massive rebirths directly, since rebirthing makes you lose everything you have. So like, I want into the process of finding price, if player chose to rebrith 5 times, it’ll count like that :
local RebirthsIHave = 1
local HowManyRebirths = 5
local price = 0
for i = 1, HowManyRebirths do
price = price + RebirthsIHave * 10000 -- The price will increase as we rebirth
RebirthsIHave = RebirthsIHave + 1
end
This would work but I don’t want to use a for loop, I want to get it done instantly, calculating the price only 1 time, meaning it will also calculate the price of the next rebirth until 5 in this case.