|
| 11 Aug 2015 07:07 PM |
I had the auto weld turned on so whenever I added a part it would add welds in it.. so now I'm cluttered with them in my parts. Can i get a script that gets the children of workspace and if the children is a part or wedge then itll remove the children in the part.
i have this but it don't work:
p= game.workspace:GetChildren() if p.ClassName == "Part" or p.ClassName == Wedge" then z = p:GetChildren() for i= 1, #z do z[i]:remove() end end |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2015 07:08 PM |
local function re(a) for _,v in pairs(a:GetChildren()) do if v:FindFirstChild("Weld") and v.Weld:IsA"Weld" then v.Weld:Destroy() end re(v) end end re(Workspace) |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 11 Aug 2015 07:12 PM |
function r(p) local p = p:GetChildren() for i = 1,#p do if p[i]:IsA("Weld") then p[i]:Destroy() else r(p[i]) end end end
r(workspace)
I don't need a siggy |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2015 07:16 PM |
17:14:20.658 - Weld is not a valid member of Part 17:14:20.658 - Script 'Workspace.Script', Line 3 - local re 17:14:20.659 - Script 'Workspace.Script', Line 9 17:14:20.659 - Stack End |
|
|
| Report Abuse |
|
|
| |
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 11 Aug 2015 07:26 PM |
Tried mine?
I don't need a siggy |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2015 07:27 PM |
| The lds names are either "Part/Wedge-To-Part/Wedge Strong Weld" and class is ManualWeld |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 11 Aug 2015 07:36 PM |
function r(p) local p = p:GetChildren() for i = 1,#p do if p[i]:IsA("ManualWeld") then p[i]:Destroy() else r(p[i]) end end end
r(workspace)
Not hard to change one word
I don't need a siggy |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2015 07:41 PM |
function r(p) local p = p:GetChildren() for i = 1,#p do p[i]:ClearAllChildren() end end |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2015 08:54 PM |
local function re(a) for _,v in pairs(a:GetChildren()) do pcall(function() v.Weld:Destroy() end) re(v) end end re(Workspace) |
|
|
| Report Abuse |
|
|