Questions about GuiElement.destroy()

  • The docs say: "destroy() Destroys this element, i.e. remove it from all players."


    1) Does it also remove the element from its parent (if any)?


    2) Does it also destroy its children (if any)?


    In other words, if I have, say, a parent GuiPanel with several children and I call its (of the parent) destroy(), may I assume that no reference remain of it and of all its children in the API? (Of course, references may remain which I have made myself and it would be the responsibility of the plug-in to clear them).


    Or it is necessary to call the destroy() method of each child?

  • Apart from the fact that the destroy() method is buggy atm (you know^^), it will remove the element from its parent though, but it will not destroy any childs. This is going to change at some point, but as long as it's necessary to add any child element manually to the player gui (instead of just adding the parent, which is our intention for future updates), it's necessary to remove all childs individually

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!