This is the code that makes a new animation, and plays it on key down.
blockanime = Instance.new("Animation")
blockanime.AnimationId = "http://www.roblox.com/asset/?id=1933843521" --- type here the animation ID
local animloader = Player.Character.Humanoid:LoadAnimation(blockanime)
animloader:Play()
And this is the key release function.
uis.InputEnded:connect(function(input,process)--Stop blocking
if input.KeyCode == Enum.KeyCode.R then
if not process then
blocking = false
wait()
Player.Character.Humanoid.WalkSpeed = 16
local animloader = Player.Character.Humanoid:LoadAnimation(blockanime)
animloader:Stop()
end
end
end)
I also tried :Destroy()ing blockanime on key release, but that didn't work, so I just copying the code that plays it, and replacing :Play() with :Stop()
