Ill post the code in a second, but I’ll discuss the main changes.
The biggest change is using a “WeldConstraint” rather than a “Weld”, this is only because I’m more familiar with these than the older deprecated(?) Welds, but I got it working nonetheless.
The script in it’s entirety. (Its a normal script with its parent being the tool)
local tool = script.Parent
local character
local mainDagger = tool.Handle
local secondaryDagger = nil
--== Functions ==--
function createSecondaryDagger()
secondaryDagger = mainDagger:Clone()
secondaryDagger.Parent = character
end
function deleteSecondaryDagger()
secondaryDagger:Destroy()
end
function positionSecondaryDagger()
local leftArm = character:WaitForChild("Left Arm")
local weld = Instance.new("WeldConstraint")
weld.Part0 = secondaryDagger
weld.Part1 = leftArm
secondaryDagger.CFrame = leftArm.CFrame * CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0,-2,1)
weld.Parent = secondaryDagger
end
function toolEquipped()
character = tool.Parent
createSecondaryDagger()
positionSecondaryDagger()
end
function toolUnequipped()
deleteSecondaryDagger()
end
-- Events
tool.Equipped:Connect(toolEquipped)
tool.Unequipped:Connect(toolUnequipped)
The most important bit is the “positionSecondaryDagger” function.
See how we’re not using welds but weldconstraints.
In addition, I’ve swapped the part0 and part1 around, so now the secondaryDagger is being welded to the left arm.
The important bit, you’ll have to tinker with the CFrame.Angles arguments as well as the cframe.new in order to position the dagger exactly where you need it.