I got the actual welding part down, but how do i make it so the player can move with the part welded to them. This is all done when the player hits a key while the tool is equipped.
tool = script.Parent
player = game.Players.LocalPlayer
stat = "undone"
tool.Equipped:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if stat == "undone" then
stat = "done"
print(key)
local head = script.Parent.Parent.Head
local part = Instance.new("Part")
part.Parent = game.Workspace
local w = Instance.new("Weld")
part.CanCollide = false
w.Part0 = head
w.C0 = head.CFrame:inverse()
w.Part1 = part
w.C1 = part.CFrame:inverse()
part.CFrame = head.CFrame * CFrame.new(0,15,0)
w.Parent = head
part.Anchored = true
wait(15)
stat = "undone"
end
end)
end)
So far the actual part goes in the proper position but the player cannot move.

1 comment
Parts must be unanchored if you want to weld them and have them move with the character.