Upgrade System like MS 2 / PSX

Hello developers!

I want to make Upgrade system like Mining Simulator 2 or Pet Simulator X but I don’t know how to make buy system for upgrades.

Example module script:

local upgrades = {
	["Player Speed"] = {
		["Level 1"] = {
			Currency = "Gems",
			Price = 500,
			Speed = 20
		},
		["Level 2"] = {
			Currency = "Gems",
			Price = 1200,
			Speed = 24
		},
	},
	["Gem Multiplier"] = {
		["Level 1"] = {
			Currency = "Gems",
			Price = 750,
			Multiplier = 1.1
		},
		["Level 2"] = {
			Currency = "Gems",
			Price = 1400,
			Multiplier = 1.2
		},
		["Level 3"] = {
			Currency = "Gems",
			Price = 2100,
			Multiplier = 1.45
		},
	}
}

return upgrades

I know that I need Remote Event which will be fired after clicking TextButton/ImageButton
But how do I make the script know the price, multiplier and currency type of the next level?

You can index the price and such like this: require(path.to.module)[“Player Speed”][“Level 1”].Price, then compare the users amount of currency to the price.