Okay I 3D Modeled a gun in blender(had to make many parts because polygon limit for roblox). I exported them into roblox as MeshParts. Everything is together now, and I need to weld it all together to be used as a tool. I went into toolbox and grabbed this script. I tried to change part to MeshPart, but no difference. ~~~~~~~~~~~~~~~~~ local Tool = script.Parent
function Weld(X, Y) local W = Instance.new("Weld") W.Part0 = X W.Part1 = Y local C = CFrame.new(X.Position) local C0 = X.CFrame:inverse() * C local C1 = Y.CFrame:inverse() * C W.C0 = C0 W.C1 = C1 W.Parent = X end
function WeldAll(A) if A:IsA("MeshPart") then Weld(Tool.Handle, A) A.Anchored = false A.CanCollide = false else for _, X in pairs(A:GetChildren()) do WeldAll(X) end end end
Tool.Equipped:connect(function() WeldAll(Tool) end)
Tool.Unequipped:connect(function() WeldAll(Tool) end)
WeldAll(Tool)
