[OPEN] How do I destroy an instance inside of a table?

I have a table full of instances and I want to destroy the instances in the table which is inside of a dictionary, is there any way to do this or do I have to create a variable?
I tried

for i,v in pairs(tablehere[character]) do
		v:Destroy()
	end

am I doing it wrong?
image

I hope I didn’t misunderstand this but I’m sure you can simply use table.clear() to empty the entire table.

You kind of misunderstood, I want to get the instance from the table, then destroy it.
Is that possible?

So you have your table and you character is the key of the instance? If so, you can call it and destroy it like this:

tablehere[character]:Destroy()

1 Like

It looks like you might be looping through the instance rather than the table.
Do you mean something like this.

for i, inst in ipairs(dict[table]) do
    inst:Destroy()
end
1 Like

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