Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Trying to find its parent?

I have workspace then a model called "CE" and I have a a part into it. In the part I have a script.

script.parent:remove()

I want to remove the model. Whats wrong?

2 answers

✓ Accepted answer

First Error, you forgot to capitalize "Parent" and remove() only works with scripts I believe. Try this:

script.Parent:Destroy() -- Destroy is a function used to remove something like a part.

2 comments

0

And I did realize I forgot to add 1 more parent. You too.. Thanks for help!

0

No problem.

The model is the parent of the part. The part is the parent of the script. Therefore, the model is script's parent's parent, not script's parent.

script.Parent.Parent:remove() -- The model, not the part.

This discussion is preserved as it was. New answers, comments, and votes are closed.