Hello there! This is a very interesting question and prooves that you are getting further into the world of ROBLOX Development. There are several methods inorder to accomplish this goal.If you are trying to Stop an animation, you must stop it from the humanoid. Additionally, please note that :Stop() are not methods. There are several solutions. First is the most basic solution: An Event.
An event is a piece of code that recieves an execution when a certain action is met, or when something becomes fired. An example of this is PlayerAdded, which is an event which is executed when a client connects to the server, basically when a new user joins the game. Roblox provides us with RBXScriptSignals (aka events) which are fired whenever an event take place Events can go in several ways, example:
game.Players.PlayerAdded:Connect(function()
end)
or
function color
end
game.Players.PlayerAdded:Connect(color)
Basically events are useful in many ways. In our scenario, we will use an event known as Stopped.
Example:
ReloadAnim.Stopped:Connect(function()
print("The animation has stopped playing.")
end)
You can control what happens when the event is executed. In this scenario, the event is when the animation stops, and we can control the code and how we use it. .Stopped is an event we can use for activationg a set of code for when an animation has stopped playing.
Secondly, you can make the program continue on a wait until the animation stopped. Making the application(or game) wait and pause until the animation is done playing can be a significant method. Here is how you will accomplish it:
ReloadAnim.Stopped:Wait()
print("The animation is done executing")
These methods are not only super accessible but also provide functionality and can be useful for controlling what happens after an animation is done executing. Don't forget these are only basic solutions. There are several more advanced options that the more efficient developers use. Explore wikia, developerhubs, and even youtube for more powerful solutions!
Here is my final example on how ScriptingHelpers user,Internal_1, has created a method that allows him to call a "StopAnimations" method which will immediately stop the animations being played, and is extremely unique.
local Animations = script.Animations:GetChildren()
function stopAnimations()
local playing = game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()
for _,Anim1 in pairs(playing) do
for _,Anim2 in pairs(Animations) do
if Anim1.Animation == Anim2 then
Anim1:Stop()
break
end
end
end
end
stopAnimations()
There you have it. This is the solution to your problem in debt. You get your knowledge, I get my scriptinghelpers rep and a checkmark on this awnser, and it all works out in the end :)