So I have this here that runs in the command bar which replaces a torso mesh (now deprecated) into a block and two wedges. I run this code in the command bar.The script works fine by itself but I need decals to be applied on all sides on the new block and wedges because the game cannot work well without them.How do I link a decal to it and apply it to all sides of all newly created parts?
local properties = {
"Size","CFrame","Color","Material","Anchored","Locked","CanCollide",
"Transparency","Reflectance","Archivable","CollisionGroupId",
"CustomPhysicalProperties","TopSurface","BottomSurface","LeftSurface",
"RightSurface","FrontSurface","BackSurface"
}
function copyApperance(part1, part2)
for _,property in pairs(properties) do
part2[property] = part1[property]
end
end
function convertTorsoMeshToPart(torso)
local middle = Instance.new("Part")
local wedge1,wedge2 = Instance.new("WedgePart"), Instance.new("WedgePart")
copyApperance(torso, middle)
copyApperance(torso, wedge1)
copyApperance(torso, wedge2)
local middleWidth = torso.Size.X - torso.Size.Z*0.6
middle.CFrame = torso.CFrame
middle.Size = Vector3.new(torso.Size.X - torso.Size.Z*0.6, torso.Size.Y, torso.Size.Z)
wedge1.Size = Vector3.new(torso.Size.Z,torso.Size.Y,torso.Size.Z*0.3)
wedge1.CFrame = torso.CFrame * CFrame.Angles(0,math.pi/2,0) * CFrame.new(0,0,-(middle.Size.X/2+wedge1.Size.Z/2))
wedge2.Size = Vector3.new(torso.Size.Z,torso.Size.Y,torso.Size.Z*0.3)
wedge2.CFrame = torso.CFrame * CFrame.Angles(0,-math.pi/2,0) * CFrame.new(0,0,-(middle.Size.X/2+wedge2.Size.Z/2))
middle.Parent = torso.Parent
wedge1.Parent = torso.Parent
wedge2.Parent = torso.Parent
torso:Destroy()
end
print("Starting")
for _,v in pairs(game:GetDescendants()) do
pcall(function()
if v:IsA("SpecialMesh") and v.MeshType == Enum.MeshType.Torso then
convertTorsoMeshToPart(v.Parent)
end
end)
end
print("Done")
(I may know what your thinking)

4 comments
You should never use global variables. Check lines 7 and 13. Not that it's the problem but they are not encouraged. Usage of global variables is bad practice, it makes your code messy.
um ok thx
Just add a 6 decals to the part using a for do loop
but im using how would i do that