Gnomeski
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 1998 |
|
|
| 09 Oct 2016 11:43 PM |
| I've got some things in my studio i'm trying to delete. there's welds in lots of bricks in my game I want gone but I don't know how to get rid of all cause there's millions and io was wondering if there was a command I could run to delete them all in studio |
|
|
| Report Abuse |
|
|
Gnomeski
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 1998 |
|
| |
|
Gnomeski
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 1998 |
|
| |
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 09 Oct 2016 11:57 PM |
| make a function that gets all the children of whatever you input into the function then make it add all the children into a table, lastly, use the in pairs loop to loop through the table and delete anything that's a weld |
|
|
| Report Abuse |
|
|
Burglered
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 962 |
|
|
| 09 Oct 2016 11:59 PM |
for i,v in next(game.Workspace:GetChildren())do if v:FindFirstChild("Weld") then v.Weld:Destroy() end wait(0.01) end
|
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 10 Oct 2016 12:00 AM |
| ^ that wouldn't work because the welds are inside parts and not the workspace |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 10 Oct 2016 12:02 AM |
actually, try this
for i,v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") and v:FindFirstChild("Weld") then v:destroy() end end |
|
|
| Report Abuse |
|
|
Burglered
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 962 |
|
|
| 10 Oct 2016 12:23 AM |
I didnt make it find welds in workspace. I did v:FindFirstChild("Weld") not if v:IsA("Weld")
|
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 12:25 AM |
| ########################################################################################################################### |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 12:26 AM |
for i,v in pairs(game.Workspace:GetChildren()) do if v.ClassName == 'Part' then v:WaitForChild'Weld' then end end |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 10 Oct 2016 12:28 AM |
| woops, i wasn't paying attention my bad |
|
|
| Report Abuse |
|
|
Burglered
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 962 |
|
|
| 10 Oct 2016 12:28 AM |
@above
I would do if v:IsA("Part") not v.ClassName
|
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 10 Oct 2016 12:29 AM |
| u don't have to use the classname u can just say v:IsA("whateverclassyou're checking for") |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 12:30 AM |
| Doesn't matter each do the same thing. |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 10 Oct 2016 12:33 AM |
| yeah but IsA just tends to look a little better, call me crazy but it does to me |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 12:36 AM |
| Well that's your opinion i use each. Just to fetch my knowledge. |
|
|
| Report Abuse |
|
|