Expected BasePart got Accessory for Weld:Part1?

Hello! I made a script that makes it so that whenever a player clicks a button, a hair accessory appears onto them, but I get this error

Expected BasePart got Accessory for Weld:Part1.

Here is my script:

game.ReplicatedStorage.Events.HairEvent1.OnServerEvent:Connect(function(plr)
	
	local Storage = game.ReplicatedStorage.Hair.Hair1
	local char = plr.Character
	
	if char:FindFirstChild("Humanoid") then
		
		local Folder = char.Head.Hair
		
		Folder:ClearAllChildren()
		
		local head = char.Head
		local New_Hair = Storage:Clone()
		
		New_Hair.Parent = Folder
		New_Hair.AttachmentPos = head.Position
		local Weld = Instance.new("Weld")
		
		Weld.Parent = New_Hair
		Weld.Part0,Weld.Part1 = head, New_Hair
		Weld.C0 = CFrame.new(0,0,6,0)
		Weld.C1 = head.HairAttachment.CFrame
	end
end)

Can someone help me fix?

how are you confused?? literally just read the error
weld the Handle inside the accessory, not the accessory itself

be calm m8, maybe he’s starting now

1 Like

sorry it is very late where I live and I just wanted to get this done before I go to bed because I am tired. I still don’t understand it though how do I do that?

i just said

game.ReplicatedStorage.Events.HairEvent1.OnServerEvent:Connect(function(plr)
	
	local Storage = game.ReplicatedStorage.Hair.Hair1
	local char = plr.Character
	
	if char:FindFirstChild("Humanoid") then
		
		local Folder = char.Head.Hair
		
		Folder:ClearAllChildren()
		
		local head = char.Head
		local New_Hair = Storage:Clone()
		
		New_Hair.Parent = Folder
		New_Hair.AttachmentPos = head.Position
		local Weld = Instance.new("Weld")
		
		Weld.Parent = New_Hair
		Weld.Part0,Weld.Part1 = head, New_Hair.Handle
		Weld.C0 = CFrame.new(0,0,6,0)
		Weld.C1 = head.HairAttachment.CFrame
	end
end)

also why are you using welds and not weldconstraints??

1 Like

I found welds easier as this is what I’ve used before. I don’t think there is a big difference between the 2 but I just feel more comfortable using welds. Thank you for the help btw, I am just really tired

1 Like