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?
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?
beatpeat
(ScaryDifficultyFace)
April 18, 2023, 12:12pm
#4
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
Wigglyaa
(Wigglyaa)
April 18, 2023, 12:14pm
#5
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
system
(system)
Closed
May 2, 2023, 12:15pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.