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: Clone function, Y U NO WORK

Previous Thread :: Next Thread 
neongoo51 is not online. neongoo51
Joined: 12 May 2009
Total Posts: 33061
01 Apr 2012 01:23 PM
I mean, really? I can't even execute the Clone() function on a brick in the command bar.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
01 Apr 2012 01:28 PM
Are you sure you're actually giving the clone a parent?

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
neongoo51 is not online. neongoo51
Joined: 12 May 2009
Total Posts: 33061
01 Apr 2012 01:31 PM
Wait, so you have to tell it what it's parent is, or else it won't work? That's the most stupid idea ever. Its parent should be workspace if I didn't tell it what its parent is.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
01 Apr 2012 01:32 PM
No, it makes perfect sense. Instance.new() does the exact same thing, nothing happens if you don't give it a parent.
It's the way it's always been and it's the way it will always be.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
01 Apr 2012 01:34 PM
game.Workspace.Part:clone(). Without specifying where the object is located the program can't figure out where the object is, it can't see. BTW You also have to specifiy which Part, perhaps by changing the name.
Report Abuse
neongoo51 is not online. neongoo51
Joined: 12 May 2009
Total Posts: 33061
01 Apr 2012 01:34 PM
Well, if you use Insert > Object without having any other object selected, most objects automatically spawn in workspace. So it makes sense that way.
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
01 Apr 2012 01:35 PM
Oh wait. Wrong idea. Yeh. You have to specifiy where the clone is to be put.
Report Abuse
neongoo51 is not online. neongoo51
Joined: 12 May 2009
Total Posts: 33061
01 Apr 2012 01:35 PM
Kools: I did. If I didn't, the output would print an error, which it didn't.
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
01 Apr 2012 01:39 PM
It'd make sense for a cloned object's parent to be the parent of the original object but you can just do this -

function Clone(obj, par)
local new = obj:clone()
new.Parent = obj.Parent
return new end
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