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 » Scripting Helpers
Home Search
 

Re: How can I check if something exists, then remove it?

Previous Thread :: Next Thread 
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
22 Aug 2013 10:13 PM
For example, if a model had MULTIPLE parts named "Virus" in it, how would I remove them both?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
22 Aug 2013 10:14 PM
repeat
local Part = Model:FindFirstChild("PartName")
if Part then
Part:Destroy()
end
until not Model:FindFirstChild("PartName")

?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Aug 2013 10:30 PM
^ why repeat?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Aug 2013 10:30 PM
Just:

while blahblah:FindFirstChild("blah") do blahblah.blah:Destroy() end
Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
22 Aug 2013 10:57 PM
^ Because theres 2 of them
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Aug 2013 11:07 PM
madness, mine would keep removing them, faster and more efficient
Report Abuse
Brycemlns is not online. Brycemlns
Joined: 28 Jan 2008
Total Posts: 216
22 Aug 2013 11:32 PM
Would not a return(); work?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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