How do I remove parts from a dictionary?

local ogpart ="Part")

local part = ogpart:Clone()

local dict = {
    parts = {}
}[part] = {
     OGPart = ogpart

how would i remove this part from the dictionary? = {} works but its not what im looking for as I would want to put multiple parts in this dictionary.[part] = nil and table.remove(, table.find(, part)) also doesnt work[part] = nil is how you remove[part].[part].OGPart = nil will remove OGPart.
If neither of those are what you want, you might need to provide more details. This structure is a little messy.

1 Like

sorry for the messy structure yeah. I swear I tried that and when I loop through the table, the part still appears in it. I’ll try to redo this and see if I can get it to work

Sounds good. Let me know if that doesn’t work. Also if ogpart is the only entry in that second dictionary, you should probably remove the second dictionary.[part] = ogpart

This didn’t work to you because table.find works for arrays, not for dictionaries. For dictionaries you might need to do one of these:

That simply worked but made your inner table nil, hence anything in that inner table, would be nil aswell.

The solution will be what @JarodOfOrbiter already wrote above:


I had to redo how my dictionary was set up, that method now works thank you