Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a function that ungroups an object, then deletes the parent?

Asked by
314cake 17
6 years ago

Basically making the parent of the model's child and the model itself the same, and deleting the model but not its former child

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago
function ungroup(model)
    for _,v in pairs(model:GetChildren()) do
        v.Parent = model.Parent
    end
    model:Destroy()
end
Ad

Answer this question