Animation with object and player issue

  1. I would like for the musket to move with the player’s animation present in the footage.

  2. The musket will not move with the player but it works on a dummy.
    https://youtu.be/pOCKLSl1sZE

  3. I’ve tried a couple of minute changes. I have also asked some discord servers for help but to no avail.

The script is very sloppy but it is only a test.


wait(10)

local player = script.Parent
for i,v in pairs(player.Tool.StandardMusket.Parts:GetChildren()) do
	if v:IsA("BasePart") then

			v.Anchored = false
	end
end

for i,v in pairs(player.Tool.StandardMusket.AnimatableParts:GetChildren()) do
	if v:IsA("BasePart") then

		v.Anchored = false
	end
end

for i,v in pairs(player.Tool.StandardMusket.PaperCartridge:GetChildren()) do
	if v:IsA("BasePart") then
	
		v.Anchored = false
	end
end
player.Tool.StandardMusket.Handle.Anchored = false

local humanoidP = player:FindFirstChild("Humanoid")
local humanoidM = player.Tool.StandardMusket.Humanoid

local Motor6DPaperPieceToHRP = Instance.new("Motor6D",player.HumanoidRootPart)
Motor6DPaperPieceToHRP.Part0 = player.Tool.StandardMusket.PaperCartridge.PaperPiece
Motor6DPaperPieceToHRP.Part1 = player.HumanoidRootPart
Motor6DPaperPieceToHRP.Name = "Handle"

local Motor6DHandleToHRP = Instance.new("Motor6D",player.HumanoidRootPart)
Motor6DHandleToHRP.Part0 = player.Tool.StandardMusket.Handle
Motor6DHandleToHRP.Part1 = player.HumanoidRootPart
Motor6DHandleToHRP.Name = "PaperPiece"
------
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=14439146733"

local animationTrack1 = humanoidP:LoadAnimation(animation)
animationTrack1:Play()

------

local animation2 = Instance.new("Animation")
animation2.AnimationId = "http://www.roblox.com/asset/?id=14439146733"

local animationTrack2 = humanoidM:LoadAnimation(animation2)
animationTrack2:Play()

------
wait(3)


local animation3 = Instance.new("Animation")
animation3.AnimationId = "http://www.roblox.com/asset/?id=14439425779"

local animationTrack3 = humanoidP:LoadAnimation(animation3)
animationTrack3:Play()

------

local animation4 = Instance.new("Animation")
animation4.AnimationId = "http://www.roblox.com/asset/?id=14439425779"

local animationTrack4 = humanoidM:LoadAnimation(animation4)
animationTrack4:Play()
wait(.1)
animationTrack2:Stop()
animationTrack1:Stop()
-------

local animation5 = Instance.new("Animation")
animation5.AnimationId = "http://www.roblox.com/asset/?id=14498054425"

local animationTrack5 = humanoidP:LoadAnimation(animation5)
animationTrack5:Play()

------

local animation6 = Instance.new("Animation")
animation6.AnimationId = "http://www.roblox.com/asset/?id=14498054425"

local animationTrack6 = humanoidM:LoadAnimation(animation6)
animationTrack6:Play()

------
wait(3)
local animation7 = Instance.new("Animation")
animation7.AnimationId = "http://www.roblox.com/asset/?id=14533298795"

local animationTrack7 = humanoidP:LoadAnimation(animation7)
animationTrack7:Play()

------

local animation8 = Instance.new("Animation")
animation8.AnimationId = "http://www.roblox.com/asset/?id=14533298795"

local animationTrack8 = humanoidM:LoadAnimation(animation8)
animationTrack8:Play()
wait(.1)
animationTrack6:Stop()
animationTrack5:Stop()
wait(22.46)
animationTrack1:Play()
animationTrack2:Play()