✓ Accepted answer
we ended up solving it on discord.
initial problem was that you op had their parts anchored. make sure you have your parts anchored = false and cancollide false.
the parts needed to be welded and we can't do that in a local script so we put the clothing items in server storage
inside the clothing items we had a script that welded the clothing together.
the following script assumes the model has a part named 'attachPart' that is the size and position of the body part you want to attach the clothing to.
local attachPart= script.Parent:WaitForChild("attachPart")
local descendants = script.Parent:GetDescendants()
for i, desc in ipairs(descendants)do
if desc:IsA("BasePart") or desc:IsA("UnionOperation") then
desc.Anchored = false
desc.CanCollide = false
local weldConstraint = Instance.new("WeldConstraint")
weldConstraint.Part0 = attachPart
weldConstraint.Part1 = desc
weldConstraint.Parent = attachPart
model.PrimaryPart = attachPart
end
end
the model we wanted to attach to the character was a vest, so when the players character loaded, we cloned the vest from the replicated storage and welded it to the player's torso:
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local vest = game.ServerStorage.Vest:Clone()
vest.Parent = character.Torso
local weldConstraint = Instance.new("WeldConstraint")
weldConstraint.Part0 = character:WaitForChild("Torso")
weldConstraint.Part1 = vest.attachPart
weldConstraint.Parent = vest.attachPart
vest:SetPrimaryPartCFrame(character.Torso.CFrame* CFrame.Angles(0,math.rad(180),0))
end)
end)
1 comment
When you used the weldconstraint, were the models you were trying to attach anchored or not?