How can i insert values into a dictonary from script?

local tble = {}

tble[1]= {"a"}

tble[1]= {"b"}

print(tble)

this prints

{[1] =
 [1] = {"b"}
}

i wanna get it so a and b is in [1] like

{[1] =
[1] = {"a"}
[2] = {"b"}
}

how is this done?

I think you want to be using table.insert()

e.g.

local tble = {}
tble[1] = {} -- or just tble = {{}}
table.insert(tble[1], {"a"})
table.insert(tble[1], {"b"})

print(tble)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.