generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What does parent mean?

Previous Thread :: Next Thread 
Samaraandsonic is not online. Samaraandsonic
Joined: 06 Oct 2012
Total Posts: 1402
25 Mar 2015 02:17 PM
What does parent mean? (According to scripting)
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
25 Mar 2015 02:18 PM
The Child's Parent

like.. Model.Parent is game.Workspace because Model is INSIDE the Workspace


Total Posts: 404 ---------- Not Found
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
25 Mar 2015 02:18 PM
What the object is descended from.

-Workspace
--BasePlate

BasePlate's parent is Workspace.
Report Abuse
CreativitiesUnity is not online. CreativitiesUnity
Joined: 08 Nov 2014
Total Posts: 1281
25 Mar 2015 02:19 PM
An example of a parent is a script in a brick. The brick is the parent. Think of it like your family -- Your parents are the parent of you. Another good comparison is folders. The folder is the parent of everything that's inside of it.

Hope this helped!
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
25 Mar 2015 02:19 PM
The parent of an instance is one of the instances that contains it. In terms of scripting it is the instance directly above the instance in question.

I know it's confusing, but look at this.

game
--Workspace
----Part

Workspace is the parent of Part, and game is the parent of Workspace. Workspace is directly in game, and Part is directly in Workspace.

However, game is still a parent of Part. Just an indirect one.
Report Abuse
protectiveEBob is not online. protectiveEBob
Joined: 09 Jul 2012
Total Posts: 1297
25 Mar 2015 02:30 PM
game would be an ancester of part, and can also be likened to the root folder, and all the instances ("children") inside are subfolders.
Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
25 Mar 2015 02:31 PM
Wow, you're a scripting god, Samaraandsonic. Can't believe it!
Report Abuse
RetiredColonel is not online. RetiredColonel
Joined: 10 Feb 2014
Total Posts: 2230
25 Mar 2015 02:33 PM
Example:
Model of a car.
There are bricks inside the model.
Model is parent of the bricks.
Bricks are the children of the model.
SSSSIIIIIIIIIMMMMMMMMMPPPPPLLLLLLLEEEEEEEEEEEEEEEEE
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
25 Mar 2015 02:36 PM
A Parent is someone who raises you. Duh.
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
25 Mar 2015 02:39 PM
^ ur an idiot
Report Abuse
blooo127127 is not online. blooo127127
Joined: 22 Jul 2010
Total Posts: 403
25 Mar 2015 02:39 PM
What a Parent is on Roblox.

How grouping works on Roblox is that, well, you can put stuff inside other stuff. Not physically, not like a brick inside another brick. So:

Parent is the object above another object

TestExampleOne
|
|--Potato
| |--Triangle
|
|--Luna_Is_Best_Pony
|
|--AnotherExample
| |--Sock
|

The parent of 'Sock' is 'AnotherExample'. The parent of 'AnotherExample' is 'TestExampleOne'. The parent of 'Potato' is 'TestExampleOne'. I didn't list all the items, but you should get the idea.
That is the essence of what a "Parent" is in coding.

Copied from another post I made: http://www.roblox.com/Forum/ShowPost.aspx?PostID=158582621
Report Abuse
SummerEquinox is not online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
25 Mar 2015 02:41 PM
In simplest form its what the "object/item" is inside of.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
25 Mar 2015 08:20 PM
@Roblok1 you obviously have no idea what sarcasm is, idiot.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 08:59 PM
ROBLOX has a hierarchy system.

Everything that is the game is, is called game. Everything that has a physical form is in the Workspace, which is in the game. ROBLOX's hierarchy system uses dot notation, so to get the Workspace you say:

game.Workspace

Now lets say you have a part in your game, and it is called 'Part1'. To get the Part via script, you say:

game.Workspace.Part1

The parent of Part1, is the Workspace, and the parent of Workspace, is game.

With this, you could alter the properties of the Part, here is an example:

game.Workspace.Part1.Transparency = 0.5

Note: Transparency is a property.

What if you were so excited and wanted two see-through parts? You copy and paste 'Part1'. Only one of the parts appears transparent. The reason is they both have the same name.

A way around this, is to put the Script inside the part.

Scripts have a special keyword to refer to themselves called 'script'. If you said:

print(script.Name)

it would print whatever the name of the current script you are typing it in is.

Because the script is inside the part, the hierarchy is now:

game.Workspace.Part1.Script

however, because there are 2 'Part1' objects, so that won't work.

This is where we use the special keyword 'script'. Because the parent of script is the Part, to get the Part, we can simply say:

script.Parent

and alter it the same

script.Parent.Transparency = 0.5
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 09:01 PM
however, because there are 2 'Part1' objects, that won't work.*
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Mar 2015 09:01 PM
i dont think it took 13 people to answer such a simple question
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 09:03 PM
Apparently it did. I said everything that needed to be said, and hardly of any of it was said before me.

It shouldn't take 13 people to answer such a simple question, but it did.

Go team.
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
25 Mar 2015 09:09 PM
Nope Your All Wrong A Parent Is The Original Creater For Example print(game.Players.LocalPlayer) = Player.PlayerConnect Cause when u call PlayerConnect in The C Side It Calls CreateLocalPlayer And A Child Is Something Created For Example . GetChildren(Player.PlayerConnect) -> {You Player } Then A Descendent Is An Object In An Object And An Ancester Is Above So If U need The Level 1 Ancestor Just Get Ancestors Its The [1] Result . Hope This Helped ! Good Wishe's <3
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
25 Mar 2015 09:09 PM
ehh, you said an over abundance
could've just said a parent is whatever an instance derives from
she probably wouldn't have gotten it, though lol

-=Robo=-
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 09:15 PM
I would of done better to narrate my own YouTube tutorial on the ROBLOX hierarchy. However I think I did well on explaining it.
Report Abuse
LegoDude9630 is not online. LegoDude9630
Joined: 05 May 2011
Total Posts: 7177
25 Mar 2015 09:18 PM
a parent is basically what owns another thing
so let's say we have a part, and we add fire to it
the fire is the child, and the part is the parent
another example is:
if we insert a part into Workspace (The place bricks and parts and such are seen)
the part's parent is now Workspace
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
25 Mar 2015 09:18 PM
the question is answered
please stop

-=Robo=-
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Mar 2015 09:22 PM
"how many scripters does it take to answer the meaning of parent?"
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
25 Mar 2015 09:25 PM
I want to take my part, although ~20 others have already answered.
Hard to explain, but I'll try,

Say, we have a family. The mom and dad are the 'main' bases, or Workspace, like in ROBLOX. This is the parent. The child is the part in Workspace, or the mom and dad's son/daughter. This is what is in Parent.

Here's a descriptive version.

Game (what everything is put in, nothing can be the parent of this, since it is the parent of everything else.)
- Workspace (what any physical object is put in, the child, or descendant of Game, parent of Part.)
-- Part (the child, or descendant of Workspace, parent of Script)
--- Script (the child, or descendant of Part)

It's like a branch with leaves. The leaves are the branches' child. The branch is the parent of the leaves.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Mar 2015 09:25 PM
Beginners flock to the easy ones because they feel so good they finally know the answer to a question here.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image