How do I insert a variable into a table with a specific name?

Basically I want to add a variable into a table, as seen below, but the name of it always defaults to 1 when add into it.

This is before and after I add the value I want into the table
image_2024-05-12_193658453

local NewItem = {
     Name = ItemName,
     Value = false,
}
			
table.insert(PlayerTable, NewItem)
1 Like

What you have here is a dictionary, a key and a value pair.
Rather than doing table.insert you would just set it like this:

PlayerTable["ItemName"] = NewItem
3 Likes

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