FatalizerJoin Date: 2011-08-28 Post Count: 1520 |
local Tab = {} --This is an empty table
local Tab = {"value"} --This is a table with a value in it
local Tab = {"value1", "value2"} --This is a table with multiple values in it
local Tab = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} --This table has numbers in it.
local Tab = {1,2,3,4,5,5,6,7,8,9,10,11,12,13,14,15} --A table can have lots of values in it
local Tab = {"Hi", 1, Vector3.new(1,1,1), function() print("hello") end} --A table can have different types of values in it
local Tab = {{}, {{}, {}}, {}} --A table can even have another table in it
local Tab = {"hello", "world"} --A table with 2 strings in it
print(Tab[1], Tab[2]) --Printing the contents of the table, indexing is done using []
local Dictionary = {Hello = "hi"} --A dictionary, key value pairs
print(Dictionary.Hello) --Indexing a dictionary
local TabDictionary = {1, 2, Hello = "hi", "XD" = 1} --Both a table and dictionary in one! This can get complicated however
--[[There are also multiple types of functions that can be used with tables, many of them are included in the table library, however there are others such as pairs, ipairs, next, and unpack --]]
~ I don't rekt kids, I eat them ~ |