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 would I regenerate all descendants of a script?

Previous Thread :: Next Thread 
randomsmileyface is not online. randomsmileyface
Joined: 01 Aug 2010
Total Posts: 4538
06 Oct 2013 01:35 PM
How would I take all the descendants of an object.
clone them
destroy them
and set the clones back where the originals were?

any1 know a function for that?
Report Abuse
Iterations is not online. Iterations
Joined: 22 Jul 2013
Total Posts: 751
06 Oct 2013 01:39 PM
local Backup,Parent={},Workspace.Model

for i,v in pairs(Parent:GetChildren()) do
Backup[i]=v:clone()
end

while wait(25) do
Parent:ClearAllChildren()
for i,v in pairs(Backup)do
v:clone().Parent=Parent
end
end
Report Abuse
randomsmileyface is not online. randomsmileyface
Joined: 01 Aug 2010
Total Posts: 4538
06 Oct 2013 01:45 PM
a bit complex, but thanks :D
Report Abuse
randomsmileyface is not online. randomsmileyface
Joined: 01 Aug 2010
Total Posts: 4538
06 Oct 2013 09:56 PM
hey is there any way I could make it not have to wait a whole 25 seconds?

Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
06 Oct 2013 09:59 PM
time=10 --change the number 10 to how long you want it to wait

for i,v in pairs(Parent:GetChildren()) do
Backup[i]=v:clone()
end

while wait(time) do
Parent:ClearAllChildren()
for i,v in pairs(Backup)do
v:clone().Parent=Parent
end
end
Report Abuse
randomsmileyface is not online. randomsmileyface
Joined: 01 Aug 2010
Total Posts: 4538
06 Oct 2013 10:02 PM
by that, I meant a time determined by once all the children are back as descendants of the parent
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
06 Oct 2013 10:04 PM
I don't understand what you're saying .-.
Report Abuse
randomsmileyface is not online. randomsmileyface
Joined: 01 Aug 2010
Total Posts: 4538
06 Oct 2013 10:07 PM
something like

WaitForChild()


but I just also figured out, this won't work for my script.
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
06 Oct 2013 10:08 PM
Why is that?
Report Abuse
randomsmileyface is not online. randomsmileyface
Joined: 01 Aug 2010
Total Posts: 4538
06 Oct 2013 10:10 PM
I tried using this to immediately stop an animation script

I have tried stuff like

animationblablablah.Disabled = true
repeat wait() until animationblablablahDisabled == true

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