Couldn’t find a better title for this so sorry for any confusion.
I want to attach these mesh parts to a player’s character so they “wear” it. How would I go about doing that?
I already have a simple script to weld all the parts to the player
local function attachparts(player, MorphName)
local morph = game.ReplicatedStorage.Morphs:FindFirstChild(MorphName)
if morph then
print("Found Morph!")
local minrank = morph:FindFirstChild("MinRank")
local groupid = morph:FindFirstChild("Group")
if player:GetRankInGroup(groupid.Value) >= minrank.Value or player.Name == "spirasto" then
print("player is in group")
local character = player.Character
local morphclone = morph:Clone()
local parts = morphclone.Morph:GetChildren()
print("variables")
for _, v in pairs(parts) do
print(v)
if v:IsA("MeshPart") and character:FindFirstChild(v.Name) then
v.Anchored = false
v.CanCollide = false
print("meshpart found")
print("welding parts")
v.Position = character:FindFirstChild(v.Name).Position
v.Orientation = character:FindFirstChild(v.Name).Orientation
v.Parent = character:FindFirstChild(v.Name)
local weld = Instance.new("WeldConstraint")
weld.Part0 = character:FindFirstChild(v.Name)
weld.Part1 = v
weld.Parent = weld.Part0
end
end
end
end
end
But it’s not very efficient as it results in lots of clipping