local assetId=47637
game:GetService("InsertService"):LoadAsset(assetId).Parent=scparent.Backpack
This creates a model in the player's Backpack, how could I ungroup it using code?
local assetId=47637
game:GetService("InsertService"):LoadAsset(assetId).Parent=scparent.Backpack
This creates a model in the player's Backpack, how could I ungroup it using code?
What you're trying to do requires simply parenting the inserted model to your wanted location, iterating through said model, and parenting all of it's childern to the model's parent. Afterwards you can just delete the inserted model.
local insert = game:GetService("InsertService")
local assetId
function unGroup(model)
for _,v in next,model:GetChildren() do
v.Parent = model.Parent
end
model:Destroy()
end
local model = insert:LoadAsset(assetId)
model.Parent = scparent.Backpack
unGroup(model)
This discussion is preserved as it was. New answers, comments, and votes are closed.