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
 

How do you clone all children inside a model?

Previous Thread :: Next Thread 
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 11:15 AM
GetChildren just gives you a "Read-Only" list.
I need to clone all the children inside a model, so I can copy it and move it into another model using scripts.
Report Abuse
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 11:26 AM
Doesn't anyone know how to do this?
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
18 Sep 2017 11:36 AM
:clone()
Report Abuse
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 11:38 AM
No you don't understand, I don't want to clone the model, I want to clone it's children so I can move them to another model, I do not want the model itself cloned.
Report Abuse
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 11:41 AM
Perhaps :GetDescendants?
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
18 Sep 2017 11:41 AM
:GetChildren()
Report Abuse
igrach2 is not online. igrach2
Joined: 09 Mar 2017
Total Posts: 252
18 Sep 2017 11:43 AM
for i,v in ipairs(model:GetChildren())do
v:Clone().Parent=newmodel
end
Report Abuse
WillieTehWierdo200 is not online. WillieTehWierdo200
Joined: 13 Aug 2008
Total Posts: 1147
18 Sep 2017 11:43 AM
local newModel = ...
local oldModel = ...

local copy = oldModel:Clone()
for _, obj in pairs(copy:GetChildren()) do
obj.Parent = newModel
end
newModel:MakeJoints()
copy:Destroy()
Report Abuse
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 11:45 AM
local zChildren = game.Workspace.Model:GetChildren()
zChildren:Clone()
zChildren.Parent = Game.Workspace.Model2

Returns index error.
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
18 Sep 2017 11:48 AM
because you created a local variable
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
18 Sep 2017 11:50 AM
and why is game capitalised
Report Abuse
igrach2 is not online. igrach2
Joined: 09 Mar 2017
Total Posts: 252
18 Sep 2017 11:52 AM
wait()
local model2=workspace.Model2
for i,v in ipairs(workspace.Model:GetChildren())do
v:Clone().Parent=model2
end
Report Abuse
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 11:58 AM
^ Tried that, doesn't work, does not return an error though.

How would I make this script below work?
zChildren = game.Workspace.Model:GetChildren()
zChildren:Clone()
zChildren.Parent = game.Workspace.Model2

I honestly don't understand, sorry if I am upsetting any of you, I'm still learning how to script.
Report Abuse
Rex005X is not online. Rex005X
Joined: 28 Apr 2016
Total Posts: 1245
18 Sep 2017 12:02 PM
local zChildren = game.Workspace.Model:GetChildren()
local Cloned = zChildren:Clone()
Cloned.Parent = game.Workspace.Model2

Returns clone nil value.
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