Here's the script:
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() local h1 = game.ReplicatedStorage.Hairs.h1:Clone() h1.Name = "h1" h1.Parent = player.Character.Head local weld = Instance.new("Weld") weld.Parent = h1 weld.Part0 = player.Character.Head weld.Part1 = h1 weld.C0 = CFrame.new(0,0,0) end)
So the h1 parent is alright, weld parent is also alright, weld part0 and part1 are alright too but the actual welding doesn't happen, the part just doesn't get attached to the head.Any solutions?
You need to set the weld's C1
to:
weld.C1 = h1.CFrame:toObjectSpace(player.Character.Head.CFrame);
Also, more of a suggestion, but I recommend you try out WeldConstraints
. It's basically just a normal weld, except all the annoying c0
and c1
crap is handled for you.