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 » Game Design
Home Search
 

Clone()

Previous Thread :: Next Thread 
hdtv13 is not online. hdtv13
Joined: 18 Sep 2012
Total Posts: 1628
24 Feb 2015 11:48 PM
a = script.thing:clone()

children = script.Parent.Parent:GetChildren()
for i =1, #children do
if children[i] ~= nil then
if children[i]:IsA("VehicleSeat") then
a.Parent = <- What do I put there?
end
end
end

I'm blue I'm in need of a guy, If I were green I would die, I repeat I would die, I got more apple pie, Bacon I fry.
Report Abuse
bobthesnailboy is not online. bobthesnailboy
Joined: 02 Mar 2009
Total Posts: 7766
25 Feb 2015 12:11 AM
a.Parent = <- What do I put there?



You put where you would like the clone of the "thing" being cloned inside of the script to go.
Report Abuse
bobthesnailboy is not online. bobthesnailboy
Joined: 02 Mar 2009
Total Posts: 7766
25 Feb 2015 12:15 AM
children = script.Parent.Parent:GetChildren()
for i =1, #children do
if children[i] ~= nil then
if children[i]:IsA("VehicleSeat") then
local a = script.(WHAT YOU WANT TO CLONE HERE):Clone()
a.Parent = (WHERE YOU WANT WHAT YOU CLONED TO END UP)
end
end
end

I am assuming that you want to clone the items in the script's Parent.Parent
in which case:
for i =1, #children do
if children[i] ~= nil then
if children[i]:IsA("VehicleSeat") then
local a = children[i]:Clone()
a.Parent = (WHERE YOU WANT WHAT YOU CLONED TO END UP)
end
end
end
Report Abuse
hdtv13 is not online. hdtv13
Joined: 18 Sep 2012
Total Posts: 1628
25 Feb 2015 05:54 PM
NoNo, I need to clone into the children e.g

a = script.Parent:clone()
a.Parent = Children
if you get me?

I'm blue I'm in need of a guy, If I were green I would die, I repeat I would die, I got more apple pie, Bacon I fry.
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
25 Feb 2015 06:07 PM
Loops.

:Clone(), not :clone()
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
25 Feb 2015 06:08 PM
Clone the thing inside the loop
Report Abuse
bobthesnailboy is not online. bobthesnailboy
Joined: 02 Mar 2009
Total Posts: 7766
25 Feb 2015 06:19 PM
a=script.Thing:Clone()

children=script.Parent.Parent:GetChildren()
for i = 1, #children do
if children[i] ~=nil then
if children[i]:IsA('VehicleSeat') then
a.Parent= script.Parent.Parent:FindFirstChild(tostring(children[i])
end
end
end

This will work. Sorry for the confusion m8
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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