This is my first approach. But this seems stuttering a lot for me. What's the best and simplest way?
1 | script.Parent.Equipped:Connect( function (mouse) |
2 | mouse.Button 1 Down:Connect( function () |
3 | local slash = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Slash) |
4 | end ) |
5 | end ) |
Hello. The problem is that you did not :Play()
the animation. Also, I'd use Tool.Activated
as it fires when a Tool is clicked and it just saves you lines of code. Here is the code that will work:
1 | script.Parent.Activated:Connect( function () |
2 | local slash = game:GetService( "Players" ).LocalPlayer.Character.Humanoid:LoadAnimation(script.Slash) |
3 | slash:Play() |
4 | end ) |
5 | end ) |