@FromLegoUniverse I don’t think that is the issue, because I have a joint utility plugin (for welds) that has the bug. Here’s the source code.
[code]local plugin = plugin
local toolbar = plugin:CreateToolbar(“Welding”)
local buttonManualWeld = toolbar:CreateButton(“ManualWeld”, “”, “rbxassetid://192346804”)
local buttonMotor6D = toolbar:CreateButton(“Motor6D”, “”, “rbxassetid://192351405”)
local buttonBreak = toolbar:CreateButton(“BreakJoints”, “Call :BreakJoints() on Models and BaseParts in selection9”, “rbxassetid://192346846”)
local selection = game:GetService(“Selection”)
function getAll(class, object, t)
t = t or {}
for k, child in pairs(object:GetChildren()) do
getAll(class, child, t)
end
if object:IsA(class) then
t[#t + 1] = object
end
return t
end
function join(class, partA, partB)
local joint = Instance.new(class)
joint.Part0 = partA
joint.Part1 = partB
joint.C0 = CFrame.new()
joint.C1 = partB.CFrame:inverse() * partA.CFrame
joint.Parent = partA
end
function joinAll(class, mainPart, otherParts)
for i = 1, #otherParts do
local other = otherParts[i]
if other:IsA(“BasePart”) then
join(class, mainPart, other)
end
end
if #otherParts > 2 then
print("Joined " … mainPart.Name … " to " … #otherParts … " other parts with " … class)
elseif #otherParts == 1 then
print("Joined " … mainPart.Name … " to " … otherParts[1].Name … " with " … class)
end
end
function generateOnClickJoiner(class)
return function ()
local sel = selection:Get()
local mainPart = sel[1]
local otherParts = {}
for i = 2, #sel do
otherParts[#otherParts + 1] = sel[i]
if not sel[i]:IsA(“BasePart”) then return end
end
if mainPart and mainPart:IsA(“BasePart”) and #otherParts > 0 then
joinAll(class, mainPart, otherParts)
else
print(“Select two or more BaseParts”)
end
end
end
buttonManualWeld.Click:connect(generateOnClickJoiner(“ManualWeld”))
buttonMotor6D.Click:connect(generateOnClickJoiner(“Motor6D”))
buttonBreak.Click:connect(function ()
local sel = selection:Get()
for k, object in pairs(sel) do
if object:IsA(“Model”) or object:IsA(“BasePart”) then
object:BreakJoints()
end
end
end)
– 10/15/2014 12:33 AM
[/code]