Accessories working on the server but not the client

So basically, I have this modulescript. It makes a clone of the player, but when it does the accesories on the clientside, all of them are hundreds of studs away from the player.

local BodyScaledOk = {
	["BodyDepthScale"] = true,
	["BodyHeightScale"] = true,
	["BodyProportionScale"] = true,
	["BodyTypeScale"] = true,
	["BodyWidthScale"] = true,
	["HeadScale"] = true	
}
local module = function(UserId, Pos, BodyTypeScale, DefaultBody, RigType, Parent)
	local Character = game.Players:GetCharacterAppearanceAsync(UserId)
	local ClonedRig = script[RigType]:Clone()

	for i, v in pairs(Character:GetChildren()) do
		if BodyScaledOk[v.Name] and BodyTypeScale == true and RigType ~= "R6" then
			v.Parent = ClonedRig.Humanoid
		end
		if DefaultBody == true then
			if v:IsA("SpecialMesh") then
				ClonedRig.Head:FindFirstChildOfClass("SpecialMesh"):Destroy()
				v.Parent = ClonedRig.Head
				
			end
			if RigType == "R6" then
				if v.Name == "R6" then
					v:FindFirstChildOfClass("CharacterMesh").Parent = ClonedRig
				end
			else
				if v.Name == "R15ArtistIntent" then
					for i, e in pairs(v:GetChildren()) do
						ClonedRig.Humanoid:ReplaceBodyPartR15(Enum.BodyPartR15[e.Name], e)
					end
				end
			end
		end
		if v:IsA("Accessory") then
			v.Parent = ClonedRig
			v.AccessoryType = Enum.AccessoryType.Hat
			v.Handle.Positon = ClonedRig.Head.Position
			local AccessoryWeld = Instance.new("WeldConstraint",v.Handle)
			AccessoryWeld.Part0 = v.Handle
			AccessoryWeld.Part1 = ClonedRig.Head
		elseif v:IsA("BodyColors") or v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") then
			v.Parent = ClonedRig	
		elseif v:IsA("Decal") then
			ClonedRig.Head:FindFirstChildOfClass("Decal"):Destroy()
			v.Parent = ClonedRig.Head
		end
	end
	Character:Destroy()
	ClonedRig.Name = game.Players:GetNameFromUserIdAsync(UserId)
	ClonedRig.Parent = Parent
		
	return ClonedRig
end

return module

Here’s what I’m using on both the server and client:


clone = InsertCharModule(game.Players:GetUserIdFromNameAsync(player.Name), character.HumanoidRootPart.Position, false, false, "R15",characterCloneModel)

Here’s the module
CharacterInsert.rbxm (29.3 KB)

Try setting the WorldPosition of the accessory attachment AFTER parenting it to the clone. If that doesn’t work, try doing it before setting the parent.

1 Like