Jason B.
0
Q:

table in lua

    a = {}
    x = "y"
    a[x] = 10                 -- put 10 in field "y"
    print(a[x])   --> 10      -- value of field "y"
    print(a.x)    --> nil     -- value of field "x" (undefined)
    print(a.y)    --> 10      -- value of field "y"
1
local t = {
	"hello",
    "how",
    "are",
    "you"
}

for k,v in pairs(t) do
	print("Number: "..k.."Message: "..t)
end

output:
Number: 1 Message: hello
Number: 2 Message: how
Number: 3 Message: are
Number: 4 Message: you
2

New to Communities?

Join the community