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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why doesn't this cloning script work?

Previous Thread :: Next Thread 
BloxOne is not online. BloxOne
Joined: 20 Mar 2013
Total Posts: 1505
17 Jul 2015 04:18 PM
part = script.Parent

part.Touched:connect(function()
myTest = game.Lighting.Test:Clone()
myTest.parent = game.Workspace
end)

So basically I have a part that I touch in the game, and it's supposed to copy a "Test" part that's in Lighting, and place its copy in the game. This doesn't seem to work though.

The name of the part in the Lighting is "Test"
Report Abuse
Casadis is not online. Casadis
Joined: 05 Aug 2013
Total Posts: 115
17 Jul 2015 04:19 PM
You need to MakeJoints() before setting the parent.

http://wiki.roblox.com/index.php?title=API:Class/Model/MakeJoints
Report Abuse
BloxOne is not online. BloxOne
Joined: 20 Mar 2013
Total Posts: 1505
17 Jul 2015 04:24 PM
Ah okay... Is that a relatively new thing? I was watching a tutorial from 2013 and the person didn't have to use that function.
Report Abuse
uglypoe is not online. uglypoe
Joined: 26 Mar 2011
Total Posts: 4382
17 Jul 2015 04:32 PM
part = script.Parent

part.Touched:connect(function()
myTest = game.Lighting.Test:Clone()
myTest.Parent = game.Workspace
end)


you didn't capitalize .Parent

The Ugliest Poe on LMaD ( ͡° ͜ʖ ͡°) // 26,757 RAP // R$11,917
Report Abuse
BloxOne is not online. BloxOne
Joined: 20 Mar 2013
Total Posts: 1505
17 Jul 2015 04:37 PM
Hmm.. interesting.

The myTest variable is underlined in blue.

And when I play it, it makes the clone, but when I touch the part... it clones tons of the "Test" part. I just wanted it to clone once.

Sorry for being so nooby, I just started scripting last week.
Report Abuse
DaddyRoundRound is not online. DaddyRoundRound
Joined: 05 Jun 2011
Total Posts: 88
17 Jul 2015 04:46 PM
Because it needs to be local.

part = script.Parent

part.Touched:connect(function()
local myTest = game.Lighting.Test:Clone()
myTest.Parent = game.Workspace
end)
Report Abuse
uglypoe is not online. uglypoe
Joined: 26 Mar 2011
Total Posts: 4382
17 Jul 2015 04:48 PM
CLONES IT ONCE:

part = script.Parent
Active = false

part.Touched:connect(function()
if Active == false then
Active = true
local myTest = game.Lighting.Test:Clone()
myTest.Parent = game.Workspace
end)

The Ugliest Poe on LMaD ( ͡° ͜ʖ ͡°) // 26,757 RAP // R$11,897
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