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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|