|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 15 Nov 2013 02:03 PM |
| object:clone().Parent = Newparent |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2013 02:36 PM |
Actually...
local clone = OBJECTHERE:clone() clone.Parent = bullet
:P |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 15 Nov 2013 06:18 PM |
| Thanks for you all help!!! |
|
|
| Report Abuse |
|
|
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 |
|
|