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: Lets say....

Previous Thread :: Next Thread 
tangyboxhead is not online. tangyboxhead
Joined: 23 Oct 2011
Total Posts: 9437
15 Nov 2013 10:26 AM
I have a gun. I also have 2 scripts, one that fires and just a scirpt I want in the bullet. is it possible for me to make a clone of that script, put it inside of the bullet that way stuff happens in the bullet?
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
15 Nov 2013 10:32 AM
Yep, just disable the script, and Enable it once you cloned it.
Report Abuse
tangyboxhead is not online. tangyboxhead
Joined: 23 Oct 2011
Total Posts: 9437
15 Nov 2013 01:36 PM
how would I clone it?
Report Abuse
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
15 Nov 2013 02:03 PM
object:clone().Parent = Newparent
Report Abuse
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
15 Nov 2013 02:36 PM
Actually...

local clone = OBJECTHERE:clone()
clone.Parent = bullet

:P
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
15 Nov 2013 03:10 PM
You can directly set the parent as you clone the thing.

BulletScript:Clone().Parent = Bullet

The Clone method returns an Instance, which has a Parent property.
Report Abuse
tangyboxhead is not online. tangyboxhead
Joined: 23 Oct 2011
Total Posts: 9437
15 Nov 2013 05:29 PM
So cloning will work for anything right? I mean like if I wanted to clone a...... house, that would work?
Report Abuse
tangyboxhead is not online. tangyboxhead
Joined: 23 Oct 2011
Total Posts: 9437
15 Nov 2013 06:18 PM
Thanks for you all help!!!
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
17 Nov 2013 01:32 AM
Yep.

What the Clone method does is creates a 'copy' of whatever your cloning, as well as all of its descendants. The only thing that isn't the same is the Parent property of what you have clones, which is set to nil.
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