Table

A table is similar to a list--a group of related numbers, strings, objects, or even other tables. Tables can be very useful when doing intermediate or advanced scripting.

Creating a Table
Curly brackets are used to create tables: table = {"apple", "banana", "peach", "papaya", "pear"}

Getting Data from a Table
To get data from a table, use square brackets. fruit = table[1] print(fruit) --prints "apple" anotherfruit = table[4] print(anotherfruit) --prints "papaya"

Dictionaries
You can also use tables as simple key/value pairs. The creation is similar to a normal table (array). table = {apple="green", orange="orange", banana="yellow"} Getting information is similar; you use the key name instead of a number index. color = table[banana] print(color) -- prints "yellow"

More advanced information coming soon!