I looked at the code of the plugin @ihavenomoneyshelpme sent:
I copied some of that code over and I’ve added a Convert() function that copies over the handle’s children.
local InsertService = game:GetService('InsertService')
local properties = {
"Anchored", "AssemblyAngularVelocity", "AssemblyLinearVelocity", "BackSurface", "BottomSurface", "BrickColor", "CFrame", "CanCollide","CanQuery", "Transparency",
"CanTouch", "CastShadow", "CollisionGroup", "Color", "CustomPhysicalProperties", "EnableFluidForces", "FrontSurface", "LeftSurface", "TopSurface", "Name",
"LocalTransparencyModifier", "Locked", "Massless", "Material", "MaterialVariant", "PivotOffset", "Reflectance", "RightSurface", "RootPriority", "Size"
}
local function ToMeshpart( part : BasePart ) : MeshPart
local mesh = part:FindFirstChildWhichIsA('SpecialMesh')
if not mesh then return nil end
local new = InsertService:CreateMeshPartAsync( mesh.MeshId, Enum.CollisionFidelity.Hull, Enum.RenderFidelity.Automatic )
for _, property in properties do
new[property] = part[property]
end
new.TextureID = mesh.TextureId
new.Size = mesh.Scale * new.MeshSize
mesh:Destroy()
return new
end
local function Convert( accessory : Accoutrement )
local handle = accessory:FindFirstChild('Handle') :: BasePart
if not handle or handle:IsA('MeshPart') then return end
local mesh = ToMeshpart( handle )
if not mesh then return end
for _, child in handle:GetChildren() do
if child:IsA('TouchTransmitter') then continue end
child.Parent = mesh
end
handle:Destroy()
mesh.Parent = accessory
end
local fedora = workspace.Rig.Fedora
Convert( fedora )
It creates a MeshPart using InsertService, copies over the SpecialMesh’s properites, then calculates it’s size and assigns the TextureID.
Then, it deletes the SpecialMesh, moves the Handle’s children to our MeshPart, and now our accessory is converted.
You are unable to assign a parent to TouchTransmitters (or TouchInterests), but we can safely ignore them because one will be automatically created.
Hope this helps!