You can put this code into a module script and then call the module script and just send over the Bundle Id and character.
Roblox doesn’t allow you to just change the MeshId on characters, not sure as to why but because they don’t you have to replace them with new parts and rig it.
What this code does:
Get’s the package and accessories out of the bundle, imports them, takes the folders and applies the body parts in the folders to the character. Works with both R6 and R15. I’d recommend looking over the code so you may get some learning out of it and see what’s going on. If you have any questions just message me 
local as = game:GetService('AssetService')
local is = game:GetService('InsertService')
local marketplaceService = game:GetService('MarketplaceService')
local assetTypeDic = {
[27] = Enum.AssetType.Torso,
[28] = Enum.AssetType.RightArm,
[29] = Enum.AssetType.LeftArm,
[30] = Enum.AssetType.RightLeg,
[31] = Enum.AssetType.LeftLeg,
[17] = Enum.AssetType.Head,
[41] = Enum.AssetType.HairAccessory,
[42] = Enum.AssetType.FaceAccessory,
[43] = Enum.AssetType.NeckAccessory,
[44] = Enum.AssetType.ShoulderAccessory,
[45] = Enum.AssetType.FrontAccessory,
[46] = Enum.AssetType.BackAccessory,
[47] = Enum.AssetType.WaistAccessory,
[57] = Enum.AssetType.EarAccessory,
[58] = Enum.AssetType.EyeAccessory
}
local function buildJoint(parentAttachment, partForJointAttachment)
local jointname = parentAttachment.Name:gsub("RigAttachment", "")
local motor = partForJointAttachment.Parent:FindFirstChild(jointname)
if not motor then
motor = Instance.new("Motor6D")
end
motor.Name = jointname
motor.Part0 = parentAttachment.Parent
motor.Part1 = partForJointAttachment.Parent
motor.C0 = parentAttachment.CFrame
motor.C1 = partForJointAttachment.CFrame
motor.Parent = partForJointAttachment.Parent
end
local function buildRigFromAttachments(last, part)
for _, attachment in pairs(part:GetChildren()) do
if attachment:IsA("Attachment") and string.find(attachment.Name, "RigAttachment") then
for _, sibling in pairs(part.Parent:GetChildren()) do
if sibling ~= part and sibling ~= last then
local matchingAttachment = sibling:FindFirstChild(attachment.Name)
if matchingAttachment then
buildJoint(attachment, matchingAttachment)
buildRigFromAttachments(part, matchingAttachment.Parent)
end
end
end
end
end
end
local function getOldCharacterMesh(character, newCharacterMesh)
for _, obj in pairs(character:GetChildren()) do
if obj:IsA("CharacterMesh") and obj.BodyPart == newCharacterMesh.BodyPart then
return obj
end
end
return nil
end
local function applyBodyPart(character, r15Folder, r6Folder)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid.RigType == Enum.HumanoidRigType.R15 then
for _, part in pairs(r15Folder:GetChildren()) do
local oldPart = character:FindFirstChild(part.Name)
part:Clone().Parent = character
oldPart.Name = ""
oldPart:Destroy()
end
buildRigFromAttachments(nil, character.HumanoidRootPart)
else
for _, characterMesh in pairs(r6Folder:GetChildren()) do
local oldCharacterMesh = getOldCharacterMesh(character, characterMesh)
if oldCharacterMesh then
oldCharacterMesh:Destroy()
end
characterMesh.Parent = character
end
end
end
local function getAssetIds(bundleId)
local details = as:GetBundleDetailsAsync(bundleId)
local ids = {}
for i, detail in pairs(details) do
if type(detail) == "table" then
for _, d in pairs(detail) do
if type(d) == "table" then
for _, a in pairs(d) do
if type(a) == "number" then
local info = marketplaceService:GetProductInfo(a)
if assetTypeDic[info.AssetTypeId] then
table.insert(ids, a)
end
end
end
end
end
end
end
return ids
end
local import = {}
function import:ImportPackage(packageId, char)
local humanoid = char:FindFirstChild("Humanoid")
local rigType = Humanoid.RigType
if packageId ~= 1 then
local ids = getAssetIds(packageId)
for _, assetId in pairs(ids) do
local asset = is:LoadAsset(assetId)
if rigType == Enum.HumanoidRigType.R6 then
if asset:FindFirstChild("R6") then
applyBodyPart(selectedModel, nil, asset.R6)
else
if asset:FindFirstChildOfClass("Accessory") then
local accessory = asset:FindFirstChildOfClass("Accessory")
accessory.Parent = char
humanoid:AddAccessory(accessory)
elseif asset:FindFirstChildOfClass("Tool") then
asset.Parent = selectedModel
end
end
else
if asset:FindFirstChild("R15Fixed") then
local folder = asset:FindFirstChild("R15Fixed")
applyBodyPart(char, folder, nil)
elseif asset:FindFirstChild("R15Anim") then
asset:FindFirstChild("R15Anim").Parent = char
elseif asset:FindFirstChild("Mesh") then
selectedModel.Head:FindFirstChildOfClass("SpecialMesh"):Destroy()
asset:FindFirstChild("Mesh").Parent = char:WaitForChild("Head")
elseif asset:FindFirstChild("face") then
selectedModel.Head:FindFirstChildOfClass("Decal"):Destroy()
asset:FindFirstChild("face").Parent = char:WaitForChild("Head")
else
if asset:FindFirstChildOfClass("Accessory") then
local a = asset:FindFirstChildOfClass("Accessory")
a.Parent = char
humanoid:AddAccessory(a)
elseif asset:FindFirstChildOfClass("Tool") then
asset:FindFirstChildOfClass("Tool").Parent = char
elseif asset:FindFirstChildOfClass("Decal") then
selectedModel.Head:FindFirstChildOfClass("Decal"):Destroy()
asset:FindFirstChildOfClass("Decal").Parent = char.Head
end
end
end
end
end
humanoid.HipHeight = 1.35
end