I'm trying to make multiple parts to my crawl animation, these parts being:
Begin Animation (Get onto the ground)
Idle Animation
Crawl Animation (Main animation)
End Animation (Get up)
Issues:
- Whenever the key "C" is held down, the player is meant to play the Begin Animation the animation does not play, as the Idle Animation plays instead.
- The Idle Animation does play, but will not allow the Crawl Animation to play.
- The Crawl Animation does not play as stated above.
The *End Animation plays fine, but after it plays it goes straight to the Begin Animation starting it all over again.
Script:
Note: This script was taken originally as a free model but was edited to play multiple animations.
Player = game.Players.LocalPlayer
repeat
wait()
until Player.Character
Mouser = Player:GetMouse()
name = Player.Name
char = game.Workspace[Player.Name]
AnimationIdle = script.AnimIdle
Animation = script.Anim
Begin = script.GetDown
End = script.GetUp
idletrack = char.Humanoid:LoadAnimation(AnimationIdle)
begintrack = char.Humanoid:LoadAnimation(Begin)
animtrack = char.Humanoid:LoadAnimation(Animation)
endtrack = char.Humanoid:LoadAnimation(End)
Mouser.KeyDown:connect(function(key)
if key == "c" and char.Humanoid.Running == true then
char.Humanoid.WalkSpeed = 0
begintrack:Play()
wait(1)
animtrack:Play()
char.Humanoid.WalkSpeed = 4
char.Humanoid.JumpPower = 0
else
if key == "c" then
idletrack:Play()
end
end
end)
Mouser.KeyUp:connect(function(key)
if key == "c" then
char.Humanoid.WalkSpeed = 0
animtrack:Stop()
endtrack:Play()
char.Humanoid.WalkSpeed = 16
char.Humanoid.JumpPower = 50
end
end)
Script Hierarchy
Game > StarterGui > Crawl > AnimIdle, Anim, GetDown, GetUp
Thank you in advance if you can help!

1 comment
Sorry if it wasn't clear enough, I'm trying to make it so when you hold C you'll start crawling, and if you don't move you'll be idle. But once you release C then the player will get up and stop crawling. But it glitches out and plays idle whenever you move, and when you try to get up it plays the animation but you go right back down. The same glitch happens with your script.