Techante
|
  |
| Joined: 17 Oct 2011 |
| Total Posts: 2101 |
|
|
| 06 Apr 2015 09:26 AM |
This is how it is set out
[Model] ----[TestScript] ----[Test] ---------[Part] ---------[Part] ---------[Part] ---------[Part]
So basically There is a Model, inside the model is a TestScript and a Model called "Test". Inside the model there is 4 parts and here is the script(TestScript)
________________________________________________________________________ local Model = script.Parent.Test local ModelChildren = Model:GetChildren()
for q = 1, #ModelChildren do ModelChildren[q].Parent = workspace script.Parent:Destroy() end ________________________________________________________________________
Currently what it does is it only moves one part from model into workspace, it doesn't move all of the parts to workspace, and I can't understand why, so please can someone tell me what is wrong with the script. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 09:28 AM |
Get to the test like this
local Model = game.Workspace.Model.Test not Model = script.Parent.Test |
|
|
| Report Abuse |
|
|
Techante
|
  |
| Joined: 17 Oct 2011 |
| Total Posts: 2101 |
|
| |
|
|
| 06 Apr 2015 09:32 AM |
| I never said it would fix it, that is fixing that piece of the script. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 09:33 AM |
Well looks to me as though it would move one part and then destroy the model making nothing else happen
~Commands? Commands. www.roblox.com/Admin-item?id=232183441 |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 06 Apr 2015 09:36 AM |
| As soon as the first part is moved the parent model is destroyed, taking the script with it. |
|
|
| Report Abuse |
|
|
Techante
|
  |
| Joined: 17 Oct 2011 |
| Total Posts: 2101 |
|
|
| 06 Apr 2015 11:59 AM |
| Thanks for explaining the problem to me(even though I already knew what it was), but my question was how do I fix the problem.. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 12:02 PM |
destroy the modeel after you move all the blocks for q = 1, #ModelChildren do ModelChildren[q].Parent = workspace end
Destroy() ~Commands? Commands. www.roblox.com/Admin-item?id=232183441 |
|
|
| Report Abuse |
|
|
Techante
|
  |
| Joined: 17 Oct 2011 |
| Total Posts: 2101 |
|
|
| 06 Apr 2015 12:10 PM |
| I just fixed it, and yeh, I had to put the destroy outside the for function. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 12:11 PM |
loop*
~Commands? Commands. www.roblox.com/Admin-item?id=232183441 |
|
|
| Report Abuse |
|
|