My weapon won't play animation for character

Im trying to make the script play an animation for the character like the sword swinging or something, i’ve tried some changes but nothing seemed to work. I know I am missing something but I can’t figure out what.

(no errors in Output)

The script.

script.Parent.Activated:Connect(function()
	local animation = script.Parent.Animation
	local humanoid = script.Parent.Parent.Humanoid
	
	local animationtrack = humanoid:LoadAnimation(animation)
	animationtrack:Play()
end)

All componants:
Capture201

1 Like

I don’t see anything wrong, does the Animation have a real ID, and has that ID passed Mods?.

local Player = game:GetService(“Players”).LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

local Humanoid = Character:WaitForChild(“Humanoid”)

local Tool = script.Parent

local Anim = Humanoid:LoadAnimation(Tool:WaitForChild(“Animation”))

Tool.Equipped:Connect(function()

Anim:Play()

end)

Tool.Unequipped:Connect(function()

Anim:Stop()

end)

– Inside this on local script

What is your animation priority? Try setting it to movement, if that doesn’t work. Set it to action.

Check to make sure the animation type and body type are both either r15 or r6 because it just simply won’t play if it’s rigged for the opposite character type.