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: Command to delete things

Previous Thread :: Next Thread 
Gnomeski is not online. 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 is not online. Gnomeski
Joined: 12 Dec 2009
Total Posts: 1998
09 Oct 2016 11:45 PM
bump
Report Abuse
Gnomeski is not online. Gnomeski
Joined: 12 Dec 2009
Total Posts: 1998
09 Oct 2016 11:51 PM
bump :(
Report Abuse
XCVlll is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Gaming_Vortex is not online. Gaming_Vortex
Joined: 26 Jan 2013
Total Posts: 544
10 Oct 2016 12:25 AM
###########################################################################################################################
Report Abuse
Gaming_Vortex is not online. Gaming_Vortex
Joined: 26 Jan 2013
Total Posts: 544
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 is not online. 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 is not online. 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 is not online. 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
Gaming_Vortex is not online. Gaming_Vortex
Joined: 26 Jan 2013
Total Posts: 544
10 Oct 2016 12:30 AM
Doesn't matter each do the same thing.
Report Abuse
XCVlll is not online. 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
Gaming_Vortex is not online. Gaming_Vortex
Joined: 26 Jan 2013
Total Posts: 544
10 Oct 2016 12:36 AM
Well that's your opinion i use each. Just to fetch my knowledge.
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