generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Remove welds in workspace

Previous Thread :: Next Thread 
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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 is not online. 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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
11 Aug 2015 07:13 PM
tried it, not working..
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
11 Aug 2015 07:26 PM
hump
help
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
11 Aug 2015 07:26 PM
Tried mine?


I don't need a siggy
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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 is not online. 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
someonedie is not online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image