I want an animation to play if I have equipped it, can you fix this script?
1 | local Tool = script.Parent |
2 |
3 | Tool.Equipped:Connect( function (mouse, player) |
4 | print ( "A tool was equipped" ) |
5 | game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation) |
6 | end ) |
You need to load the Animation id instead of the animation instance itself.
For example:
1 | local Tool = script.Parent |
2 |
3 | Tool.Equipped:Connect( function (mouse, player) |
4 | print ( "A tool was equipped" ) |
5 | local animationId = script.Parent.Animation.AnimationId |
6 |
7 |
8 | game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animationId) |
9 | end ) |