I am new in Lua and I want to try display an item from an array, but it's like an array inside an array.
This is my list:
local itemlist = {
{ name="blue car", price=5000 },
{ name="red car", price=10000 },
{ name="green car", price=2000 }
}
And so if I would input the text "red car" I want it to output something like this:
The red car costs 10000 dollars.
How can I do this in lua? So far I have only found some string match examples where I can see if an array contains an item, but what I want is to output that AND the price. How do I get to the price? I have no idea where to even start.