[HELP] How can I access this data?

fishes = {
				{name = "Cod", price = 19, status = {"Caught"}, model = "A_C_Fish"},
				{name = "Catfish", price = 19, status = {"Caught"}, model = "A_C_Fish"},
				{name = "Trout", price = 19, status = {"Caught"}, model = "A_C_Fish"},
			}

I would like to access an entire set of data, such as all the attributes of COD (first one)

How would I do this?

fishes.[1].name?

fishest[1].name?

You’ll have to index the table first, unless you wanna loop through it to find for example a matching name.

fishes = {
	[1] = {name = "Cod", price = 19, status = {"Caught"}, model = "A_C_Fish"},
	[2] = {name = "Catfish", price = 19, status = {"Caught"}, model = "A_C_Fish"},
	[3] = {name = "Trout", price = 19, status = {"Caught"}, model = "A_C_Fish"}
}

-- fishes[1].name 		>> "Cod"
-- fishes[1].price 		>> 19
-- fishes[1].status 	>> table
-- fishes[1].status[1] 	>> "Caught"
-- fishes[1].model 		>> "A_C_Fish"
1 Like

wow… it was so simple thank you so much :slight_smile: I am new to lua but it’s not my first language I appreciate all the help people been giving me these last couple of days!