|
| 15 Mar 2013 10:37 PM |
error: "Parent property of Breakables is locked"
NOTE: This is part of a much larger script
cache = workspace.Breakables:clone()
function restartGame(reason) msg("ERROR: "..reason..". Restarting...") workspace.Breakables:Destroy() cache.Parent = workspace cache:MakeJoints() local items = workspace:children() for i = 1, #items do if items[i].Name == "Zed" or items[i].Name == "Tank" or items[i].Name == "Boomer" then items[i]:Destroy() end end spawnPlayers("lobby") end |
|
|
| Report Abuse |
|
|
kubuto2
|
  |
| Joined: 16 Jul 2008 |
| Total Posts: 1275 |
|
|
| 15 Mar 2013 10:45 PM |
Under msg do: if not Workspace:findFirstChild("Breakables") then return end |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2013 11:32 PM |
| You also did concatenation wrong. |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2013 07:42 AM |
| No nothing is wrong with the concatenation. Still getting the same error btw |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2013 07:48 AM |
It seems that you are trying to do something with a locked property.
What is the parent property of breakables, and what were you trying to do with it? |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2013 10:39 AM |
Its parent is workspace. I clone it, destroy it, and parent the clone to workspace.
|
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 16 Mar 2013 10:43 AM |
| What is the classname of breakables? |
|
|
| Report Abuse |
|
|
| |
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 16 Mar 2013 10:49 AM |
hm Are you sure it's that line that is causing the error? What is inside the breakables model? |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Mar 2013 12:05 PM |
| and in this thread lies all the code that handles the model |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 16 Mar 2013 12:36 PM |
:Destroy() locks an instance, meaning you can do nothing with it.
Use :Remove() in this case. |
|
|
| Report Abuse |
|
|