R6 animation tool not working

so like my bow animation isn’t working and im using a normal script (not sure if I have to use a local script) and there seem to be no errors

picture of workspace: image

local bowanimationr6 = script:WaitForChild("bowanimationr6", 1)

Tool.Activated:Connect(function()
	local Character = Tool.Parent
	if Character then
		local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
		if Humanoid then
			local LoadedAnim = nil
			if Humanoid.RigType == Enum.HumanoidRigType.R6 and bowanimationr6 then
				LoadedAnim = Humanoid:LoadAnimation(bowanimationr6)
			end
			if LoadedAnim then
				LoadedAnim:Play()
			end
		end
	end
end)
1 Like

Adding on, I tried using a local script and it still didn’t work. I made sure the animation works with R6. ^^

1 Like

Uhh…I’m not decent at th3s programming stuff but you might forgot to insert “Handle” in your tool

(edit) I think His Tool have Handle insight,my bad.

local bowanimationr6 = script:WaitForChild("bowanimationr6")
local Tool = script.Parent

Tool.Activated:Connect(function()
	local Character = Tool.Parent
	if Character then
		local Humanoid = Character:WaitForChild("Humanoid")
		if Humanoid then
			if Humanoid.RigType == Enum.HumanoidRigType.R6 and bowanimationr6 then
				local LoadedAnim = Humanoid:LoadAnimation(bowanimationr6)
				repeat
					task.wait()
				until LoadedAnim.Length > 0
				LoadedAnim:Play()
			end
		end
	end
end)
2 Likes

Succes!

Animation is taken from Devhub.
I made the script a bit different than you but the result are fantastik :smiley:
Thank @Forummer

Tool hierarchy:
Toolhierarchy

Teh code:

local Tool = script.Parent
local advancedRig = script:WaitForChild("TestAnimationR15")
      advancedRig.AnimationId = "rbxassetid://3716468774"
local Indicator = {"Succes!", "Fail"}
local Debounce = true

local function Animate()
	local Character = Tool.Parent
	if Character then
	   local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
	         if Humanoid then
			local Loaded = nil
			          if Debounce == true then
			          if Humanoid.RigType == Enum.HumanoidRigType.R15 and advancedRig then
			             Loaded = Humanoid:LoadAnimation(advancedRig)
				      if Loaded then
					     Loaded:Play()
						 print(Indicator[1])
						 Debounce = false
						 task.wait(0.8)
						 Debounce = true
				         else
						 print(Indicator[2])
			    end
			 end
		  end
	   end
	end
end

Tool.Activated:Connect(Animate)
1 Like