Hello,
Recently I have been trying to make an animation script that plays the animation I have made, but every time The user stops and carries on walking again, the animation stops and then has to repress the key to activate it. I have tried many different ways of doing this but none have worked and have just made the script more glitchy.
local Animate
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Humanoid = player.Character:FindFirstChild('Humanoid')
mouse.KeyDown:Connect(function(Key)
if Key == "c" then
local Animation = Instance.new("Animation", player.Character)
Animation.AnimationId = "rbxassetid://ID"
Animate = Humanoid:LoadAnimation(Animation)
Animate:Play()
end
end)
mouse.KeyUp:Connect(function(Key)
if Key == "c" then
Animate:Stop()
end
end)
I have also tried checking if a key has been pressed, like W, and if so, carry on the animation if crawling = true, along with trying to make the animation pause when the user isn't moving, but not ending the animation.
Would there be any way of being able to do this?
