Been meaning to add a tycoon price changer in to my game but I am runningin to a problem.

The Code below does work but I am lost on how to make it randomly generate higher numbers by the players Level.

Here what I need the code needs to do.

If player level is 0 then just multiply the prices by 5 * Level for each upgraders and its Upgrades it will need to Mutliply by the number of upgrader so if it was upgrader 1 it multiply 5 * level * 1 if it was 2 then it multiply 5 * Level * 1 by 2 and so on. it will need to then randomize the prices I have it to random the numbers and not make it just even numbers. It does this 223549123 thats how it works now but I need a better system for handling the price changer.

for id=0,5,1 do
	if id >= 1 then
		local last = 0
		for i=0,6,1 do
			if i >= 2 then
				local ma = math.floor((5.3+(id*(((1.1 + math.random())*((i+i)*id))^3.5)))*id)
				print(ma)
			else
				local ma = math.floor((5.3+(id*(((1.1 + math.random())*((i+i)*id))^4.5)))*id)
				print(ma)
			end
		end
	end
end

4 comments

0

Quick Question, what do you mean by "Upgraders"?

0

It's a tycoon.

0

It's a tycoon.

0

Correct. Its a Tycoon but Not a tycoon. Pretty much it saves players money and levels, More droppers they make the more levels they get but more levels requires more droppers. Upgraders are the Objects. so if I had one button for conveyor speeds I want to upgrade the speed down to 14 but it starts at 20 so it divide 20 by 6 giving the players 6 upgrades