I am creating an equip script for a sword. My sword doesn't set its Coordinate Frame appropriately. I don't know if this is a problem with the weld or the :PivotTo() function.
Here is what I have going on:
local PlayerArm = character:FindFirstChild("Right Arm") local newSword = weapons.Sword:Clone() newSword.Name = "Sword" newSword.Parent = PlayerArm local Handle = newSword.PrimaryPart local newWeld = Instance.new("WeldConstraint") newWeld.Name = "HandConnecter" newWeld.Part0 = PlayerArm newWeld.Part1 = Handle newWeld.Parent = PlayerArm local adjustedCFrame = PlayerArm.CFrame * CFrame.new(0,-1,0) --Lower the sword newSword:PivotTo(adjustedCFrame * CFrame.Angles(0,math.rad(90),math.rad(90)))
My guess is that you have to create the weld after using PivotTo:(). Additionally try setting Part0 to Handle and Part1 to PlayerArm.