Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is the difference between script.Parent and script.Parent.Parent?

Asked by 8 years ago

I'm just curious 'cause I am gonna do it in my game. And I want to know what is the difference between them.

1 answer

Log in to vote
2
Answered by
Acheo 230 Moderation Voter
8 years ago

You may not be prepared to create a game if you're unaware of this method.

script.Parent

Gets the script's holder

script.Parent.Parent

Gets the script's holder's holder

So for example we'll place our script in a Part which is located in Workspace

Here's a visual: script > Part > Workspace

script.Parent will connect to the part.

script.Parent.Parent will connect to Workspace.

Ad

Answer this question