How do I loop this animation without anything interrupting it?
Asked by
7 years ago Edited 7 years ago
Hi and thanks for reading my question, I've been wondering for days on how to make a looping animation that never stops, when I try to do this, It cancels when it fires another animation, and I don't know how to stop it, basically I'm starting off a function where it fires if you have been dealt a certain amount of damage(haven't added that in yet) but what I have so far is clicking on a button, however, when you click on that button the animation plays, but jumping or stop walking just cancels the animation, here's what I have so far.
01 | local a = Instance.new( 'Animation' ) |
03 | local player = game.Players.LocalPlayer |
04 | workspace:WaitForChild(player.Name, 3 ) |
05 | local trackanimation = nil |
06 | local playstance = true |
07 | function playAnimation(AnimationSource) |
08 | if playstance = = true then |
09 | trackanimation = workspace [ player.Name ] .Humanoid:LoadAnimation(a) |
15 | script.Parent.MouseButton 1 Click:connect(playAnimation) |
help is extremely appreciated! Thanks.