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 » Scripting Helpers
Home Search
 

Re: Small Question

Previous Thread :: Next Thread 
Ignifernus is not online. Ignifernus
Joined: 14 Jul 2013
Total Posts: 1071
17 Oct 2013 08:23 PM
Hey guys, I have a quick question.

For scripts, how do I have it so I can have a script change parents?

For example, to change the color of a brick: game.Workspace.Part.Brick.BrickColor = Brick Color.new("Really red")

So, to change the parent, would it be: script.Parent = Parent.new(blahblahblah)? Or something else?
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
17 Oct 2013 08:25 PM
no, but i see what ur doing. just do

Part.Parent = Trail.To.The.Part
Report Abuse
Ignifernus is not online. Ignifernus
Joined: 14 Jul 2013
Total Posts: 1071
17 Oct 2013 08:26 PM
Trail.To.The.Part?

But wouldn't I need to say it should be new? Without the new, it would just be a false statement.
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
17 Oct 2013 08:27 PM
so yeah. using Parent.new() would mean

http://www.roblox.com/All-Your-Answers-Right-Here-place?id=124686347
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
17 Oct 2013 08:28 PM
trail to the part is just my lazy way of saying

Game.Workspace.Whatevayagonnacallit
Report Abuse
Ignifernus is not online. Ignifernus
Joined: 14 Jul 2013
Total Posts: 1071
17 Oct 2013 08:29 PM
Oh, lol.

So, let's say the new parent should be StarterPack, and it is originally in Workspace.

Should I say: script.Parent = game.StarterPack
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
17 Oct 2013 08:31 PM
yes.
Report Abuse
Ignifernus is not online. Ignifernus
Joined: 14 Jul 2013
Total Posts: 1071
17 Oct 2013 08:33 PM
Ok, thanks!
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
17 Oct 2013 08:34 PM
nice to see people attempting to learn instead of requesting, its good days
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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