Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game:GetService("Players").LocalPlayer
- local p = game:GetService("Players").LocalPlayer
- local c = p.Character
- local fallAnim = "rbxassetid://4580592176"
- local jumpAnim = "rbxassetid://4580573306"
- local idleAnim = "rbxassetid://4580571798"
- local walkAnim = "rbxassetid://4580513316"
- local landAnim = "rbxassetid://4617401984"
- local climbAnim = "rbxassetid://4580565723"
- local mainAnimation = Instance.new("Animation",script)
- local human = c:FindFirstChildOfClass("Humanoid")
- local jumpdelay = 21
- local landdelay = 0
- local walk = false
- local walk2 = false
- local jump = false
- local climb = false
- local activetracks = human.Animator:GetPlayingAnimationTracks()
- local rootp = c.HumanoidRootPart
- mainAnimation.AnimationId = fallAnim
- c.Animate:Destroy()
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- for _,v in pairs(activetracks) do
- v:Stop()
- end
- function playWalk()
- mainAnimation.AnimationId = walkAnim
- local anim = human:LoadAnimation(mainAnimation)
- anim:Play()
- end
- game:GetService("RunService").RenderStepped:connect(function()
- landdelay = landdelay + 1
- jumpdelay = jumpdelay + 1
- if human:GetState() == Enum.HumanoidStateType.Jumping then
- walk2 = true
- jump = true
- jumpdelay = 0
- activetracks = human.Animator:GetPlayingAnimationTracks()
- for _,v in pairs(activetracks) do
- v:Stop()
- end
- mainAnimation.AnimationId = jumpAnim
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- human.JumpPower = 0
- end
- if human:GetState() == Enum.HumanoidStateType.Freefall then
- walk2 = true
- if jumpdelay > 14 then
- mainAnimation.AnimationId = fallAnim
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- end
- end
- if human:GetState() == Enum.HumanoidStateType.Landed then
- walk2 = true
- jump = false
- activetracks = human.Animator:GetPlayingAnimationTracks()
- for _,v in pairs(activetracks) do
- v:Stop()
- end
- mainAnimation.AnimationId = landAnim
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- landdelay = 0
- end
- if human:GetState() == Enum.HumanoidStateType.Climbing then
- if climb == false then
- activetracks = human.Animator:GetPlayingAnimationTracks()
- for _,v in pairs(activetracks) do
- v:Stop()
- end
- climb = true
- mainAnimation.AnimationId = climbAnim
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- end
- end
- if human.MoveDirection ~= Vector3.new(0,0,0) then
- if human:GetState() ~= Enum.HumanoidStateType.Climbing then
- walk2 = true
- climb = false
- if walk == false and climb == false then
- walk = true
- mainAnimation.AnimationId = walkAnim
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- end
- end
- else
- if human:GetState() ~= Enum.HumanoidStateType.Climbing then
- walk = false
- if not jump then
- if walk2 == true then
- walk2 = false
- mainAnimation.AnimationId = idleAnim
- local anim = human.Animator:LoadAnimation(mainAnimation)
- anim:Play()
- end
- end
- end
- end
- if landdelay == 10 then
- if human.MoveDirection ~= Vector3.new(0,0,0) then
- playWalk()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement