Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. repeat wait() until game:GetService("Players").LocalPlayer
  2. local p = game:GetService("Players").LocalPlayer
  3. local c = p.Character
  4. local fallAnim = "rbxassetid://4580592176"
  5. local jumpAnim = "rbxassetid://4580573306"
  6. local idleAnim = "rbxassetid://4580571798"
  7. local walkAnim = "rbxassetid://4580513316"
  8. local landAnim = "rbxassetid://4617401984"
  9. local climbAnim = "rbxassetid://4580565723"
  10. local mainAnimation = Instance.new("Animation",script)
  11. local human = c:FindFirstChildOfClass("Humanoid")
  12. local jumpdelay = 21
  13. local landdelay = 0
  14. local walk = false
  15. local walk2 = false
  16. local jump = false
  17. local climb = false
  18. local activetracks = human.Animator:GetPlayingAnimationTracks()
  19. local rootp = c.HumanoidRootPart
  20. mainAnimation.AnimationId = fallAnim
  21. c.Animate:Destroy()
  22. local anim = human.Animator:LoadAnimation(mainAnimation)
  23. anim:Play()
  24. for _,v in pairs(activetracks) do
  25. v:Stop()
  26. end
  27. function playWalk()
  28. mainAnimation.AnimationId = walkAnim
  29. local anim = human:LoadAnimation(mainAnimation)
  30. anim:Play()
  31. end
  32. game:GetService("RunService").RenderStepped:connect(function()
  33. landdelay = landdelay + 1
  34. jumpdelay = jumpdelay + 1
  35. if human:GetState() == Enum.HumanoidStateType.Jumping then
  36. walk2 = true
  37. jump = true
  38. jumpdelay = 0
  39. activetracks = human.Animator:GetPlayingAnimationTracks()
  40. for _,v in pairs(activetracks) do
  41. v:Stop()
  42. end
  43. mainAnimation.AnimationId = jumpAnim
  44. local anim = human.Animator:LoadAnimation(mainAnimation)
  45. anim:Play()
  46. human.JumpPower = 0
  47. end
  48. if human:GetState() == Enum.HumanoidStateType.Freefall then
  49. walk2 = true
  50. if jumpdelay > 14 then
  51. mainAnimation.AnimationId = fallAnim
  52. local anim = human.Animator:LoadAnimation(mainAnimation)
  53. anim:Play()
  54. end
  55. end
  56. if human:GetState() == Enum.HumanoidStateType.Landed then
  57. walk2 = true
  58. jump = false
  59. activetracks = human.Animator:GetPlayingAnimationTracks()
  60. for _,v in pairs(activetracks) do
  61. v:Stop()
  62. end
  63. mainAnimation.AnimationId = landAnim
  64. local anim = human.Animator:LoadAnimation(mainAnimation)
  65. anim:Play()
  66. landdelay = 0
  67. end
  68. if human:GetState() == Enum.HumanoidStateType.Climbing then
  69. if climb == false then
  70. activetracks = human.Animator:GetPlayingAnimationTracks()
  71. for _,v in pairs(activetracks) do
  72. v:Stop()
  73. end
  74. climb = true
  75. mainAnimation.AnimationId = climbAnim
  76. local anim = human.Animator:LoadAnimation(mainAnimation)
  77. anim:Play()
  78. end
  79. end
  80. if human.MoveDirection ~= Vector3.new(0,0,0) then
  81. if human:GetState() ~= Enum.HumanoidStateType.Climbing then
  82. walk2 = true
  83. climb = false
  84. if walk == false and climb == false then
  85. walk = true
  86. mainAnimation.AnimationId = walkAnim
  87. local anim = human.Animator:LoadAnimation(mainAnimation)
  88. anim:Play()
  89. end
  90. end
  91. else
  92. if human:GetState() ~= Enum.HumanoidStateType.Climbing then
  93. walk = false
  94. if not jump then
  95. if walk2 == true then
  96. walk2 = false
  97. mainAnimation.AnimationId = idleAnim
  98. local anim = human.Animator:LoadAnimation(mainAnimation)
  99. anim:Play()
  100. end
  101. end
  102. end
  103. end
  104. if landdelay == 10 then
  105. if human.MoveDirection ~= Vector3.new(0,0,0) then
  106. playWalk()
  107. end
  108. end
  109. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement