Tables with 2 values per 1 argument

Hello! how can I create table with 2 values per 1 argument?

-- one value (200000) per 1 argument (Supercar)
local CarCostTable = {
	["Supercar"] = 200000,
	["Supercar2"] = 50000,
	["Supercar3"] = 150000,]
}
local car = Supercar
print(CarCostTable[car])
-- one value (200000) per 1 argument (Supercar)
local CarCostTable = {
	["Supercar"] = 200000; "Common",
	["Supercar2"] = 50000; "Rare",
	["Supercar3"] = 150000; "Common",]
}
local car = Supercar
print(car.." cost ".. ??? ... " and it's ".. ???)
-- output: car Supercar and it's Common

What should I write instead of ???

And is it possible? Maybe I should create a second table? But I hope I can do it by 1 table, not 2.

local CarCostTable = {
	["Supercar"] = {Cost=200000, Type="Common"},
	["Supercar2"] = {Cost=50000, Type="Rare"},
		["Supercar3"] = {Cost=150000, Type="Common"},
	}
local car = CarCostTable.Supercar
print(" cost "..car.Cost.." and it's "..car.Type)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.