Well, the reason for this is because list is a dictionary, not an array.
Arrays and Dictionaries
Arrays are tables whose indexes are integer values
I.E.
local arr = {1,32,4434,3454543}
the above example is an array because values can be retrieved by using a integer above 0 as an index:
print(arr[2])
Dictionaries are tables whose indexes are string values
I.E.
local dict = {["me"] = "Hello",["Jeff"] = "ding"}
the above example is a dictionary because values can be retrieved by using a string an index, also, you can use the . syntax.
print(dict["me"])
print(dict.Jeff)
The table you had in your code is a dictionary and not an array
What Went Wrong
What went wrong was that you tried to remove the second value of the table list, that was a problem as list doesn't have a second value, as it is a dictionary. What you should've done was set the value corresponding with the Help index to nil :
List = {["Please"] = {}, ["Help"] = {}, ["Me"] = {}}
for i,v in pairs(List) do
print(i,v)
end
List.Help = nil
print("ding")
for i,v in pairs(List) do
print(i,v)
end
3 comments
table.remove works for arrays. You are using dictionaries, and the non numerical keys won't count towards the length of the table
try setting it to nil instead of using table.remove
If you wish to remove a dictionary entry do tab[index] = nil and that works.