I’m working on an animation system where you can use commands to play different dances for your character. How do you stop an animation without having to have the animationtrack variable?
Code:
commands.bloodpop = function(sender)
local anim = sender.Character.Humanoid:LoadAnimation(script.Pop)
anim:Play()
end
commands.stop = function(sender)
end
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
task.spawn(function()
while task.wait() do
if Humanoid.MoveDirection.Magnitude > 0 then
print("The player is moving")
else
print("The player is not moving")
end
end
end)