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: Ungroup with Script?

Previous Thread :: Next Thread 
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
05 Mar 2015 03:29 PM
Is it possible to un-group a model with script?
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
05 Mar 2015 03:31 PM
Sadly, I do not know. If not, then put all the parts in a part, and clone the part out of the model, and delete the model.
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
05 Mar 2015 03:31 PM
Clone all the children to its parent and remove the model, tada ;3
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
05 Mar 2015 03:34 PM
Model = game.Workspace.Model -- or whatever
Other = game.Workspace.Model2 -- this is where we move it

Parts = Model:GetChildren()
for i=1,#Parts do
Part = Parts[i]
Part.Parent = Other
end

Report Abuse
Stefan631 is not online. Stefan631
Joined: 23 Dec 2010
Total Posts: 1350
05 Mar 2015 03:39 PM
--ungroup

local model = workspace.Model;
for _, v in pairs(model:getChildren()) do
v.Parent = v.Parent.Parent;
end;
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
05 Mar 2015 03:41 PM
@Lua

Ew...

ew...

gross... why even...


function ungroup(model,parent)
for i,v in next, model:GetChildren() do
pcall(function()
v.Parent = parent
end)
end
end

usage:

ungroup(game.Workspace.Model,workspace)
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
14 Mar 2015 12:23 AM
@Above,

My code is crap ik.

I use old ways of doing things.
I like to take the simple way of doing things.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Mar 2015 05:06 AM
game:GetService("TestService"):DoCommand("UnGroup")



It'll only work via cmd in studio though.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
14 Mar 2015 05:12 AM
function Ungroup(model)
assert(model, "You must be trying really hard here", 2);
assert(model:IsA("Model"), "Not a model you fool", 2);
for _,i in next,model:GetChildren() do
i.Parent = model.Parent;
end;
model:Destroy();
end;
Report Abuse
GetCoded is not online. GetCoded
Joined: 14 Jul 2012
Total Posts: 47
14 Mar 2015 07:12 AM
a = game.Workspace.Model

for i = 1, #a do
a[i].Parent = game.Workspace
end
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
14 Mar 2015 06:15 PM
clone:part(2) = workspace.game

m9 = eeeee.parebr

if ebr = sdad then
kill(duad023);

cout << "Done.";

cin >> m9;

if(m9 == dasd){
cout << "m9"
}
Report Abuse
UltimateCulprite is not online. UltimateCulprite
Joined: 12 Apr 2016
Total Posts: 4
04 Jan 2017 12:29 PM
This is mine, its pretty simple:

modelRoot = game.workspace.Tower -- The model you want to ungroup
targetRoot = game.workspace -- The place you want to put the ungrouped model

for index, child in pairs(modelRoot:GetChildren()) do
child.Parent = (targetRoot)
end

modelRoot:Destroy()

Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
04 Jan 2017 12:39 PM
while thruse do
Report Abuse
UltimateCulprite is not online. UltimateCulprite
Joined: 12 Apr 2016
Total Posts: 4
06 Jun 2017 02:16 PM
I was pretty interested on this post, and I was kind of asking myself why I never needed to write a script like this before. I just wrote one right here because I was bored, #### I have not tested it, but it should work. Unfortunately, there are other scripts out there that will ungroup a model, but the other models inside it remain intact. This ### ###### ####### every single model and folder inside the model. I am open to constructive criticism as I have not tested this. If it errors, feel free to tell me. I added some notes as an attempt to make you have a greater understanding of the script.


-- script should be a child of whatever model you want to ungroup --

local model = (script.Parent) -- or whatever root you want --


while true do
wait(0.01)
for index,child in ipairs(model:GetChildren()) do
if child:IsA('Model') or child:IsA('Folder') then -- locating models --
for index,CHILD in ipairs(child:getChildren()) do
CHILD.Parent = model -- regrouping full model children --
for index,_CHILD_ in ipairs(CHILD:getChildren()) do
_CHILD_.Parent = model
end
end
if child:getChildren()[1] == nil then -- locating empty models --
child:destroy() -- deleting empty models --
end
end
end
end
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