01 | local player = game.Players.LocalPlayer |
02 | local char = player.CharacterAdded:Wait() |
03 |
04 | script.Parent.Equipped:Connect( function () |
05 | local animation = char.Humanoid:LoadAnimation(script.Parent.Animation) |
06 | animation.Priority = Enum.AnimationPriority.Action |
07 |
08 | animation:Play() |
09 | print ( "yo" ) |
10 | end ) |
I will edit this part later, need to do something
Just a few recommendations and reminders for you that may fix the code if you still need help. The first is line 2; consider replacing line 2 with this:
1 | repeat wait() until player.Character |
2 | local char = player.Character |
That will completely pause the script until the char is found.
In addition make sure the animation joints match with the character joints. An r6 anim won't work on an r15 and vise-versa.
I hope this helps. Till next time
Instead of doing it through a script, try changing the animation priority through the animation editor. (3 dots > Set Animation Priority > Action).