Plugin CoreGui Clone elements won't destroy?


My code above is the part of the code that isn’t working.

I have a script working as a plug-in that puts the gui into the CoreGui. When addButtons() is called, it first tries to clear the existing buttons, and clones the sample button, which works fine. However, clearing the buttons doesn’t seem to work! I printed the button it detected as a clone (child) before and after the :Destroy(), but it seems to just stay there and not get destroyed at all!

1 Like

Try printing child.Parent instead because :Destroy() does not remove a part just changes its parent to nil and locks it.
It could just be that there are no buttons under the scrolling frame.

Huh, it does actually change to nil after, but they seem to still stay there, at least visually…

Try cloning the entire ScreenGui in the CoreGui to StarterGui after clearing and see where the buttons are. If you can do it?

Did that, and it seems like it DOES delete the buttons, but brings them back when it adds the new ones…

Oh my god I’m actually so stupid, I had a table to keep track of all the things to add but I forgot to clear the table, so it just doubled itself every time. That’s my fault…

1 Like

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