Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player = game.Players.CKbackup
- chara = player.Character
- currcf = CFrame.fromEulerAnglesXYZ(0,0,0)
- --Clerp Animations--
- TC = chara.HumanoidRootPart.RootJoint
- HC = chara.Torso.Neck
- RAC = chara.Torso["Right Shoulder"]
- LAC = chara.Torso["Left Shoulder"]
- RLC = chara.Torso["Right Hip"]
- LLC = chara.Torso["Left Hip"]
- TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- RW = Instance.new("Weld",HC.Parent)
- RW.Part1 = HC.Parent
- RW.Part0 = chara["Right Arm"]
- RW.C0 = RWF
- LW = Instance.new("Weld",HC.Parent)
- LW.Part1 = HC.Parent
- LW.Part0 = chara["Left Arm"]
- LW.C0 = LWF
- RLW = nil
- LLW = nil
- function AddLegWelds()
- RLW = Instance.new("Weld",chara["Right Leg"])
- RLW.Part1 = HC.Parent
- RLW.Part0 = chara["Right Leg"]
- RLW.C0 = RLWF
- LLW = Instance.new("Weld",chara["Left Leg"])
- LLW.Part1 = HC.Parent
- LLW.Part0 = chara["Left Leg"]
- LLW.C0 = LLWF
- end
- function DestroyLegWelds()
- RLC = New("Motor6D",chara.Torso,"Right Hip",{Part0 = chara.Torso,Part1 = chara["Right Leg"],C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),})
- LLC = New("Motor6D",chara.Torso,"Left Hip",{Part0 = chara.Torso,Part1 = chara["Left Leg"],C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),})
- RLW:Destroy()
- LLW:Destroy()
- end
- function clerp(a,b,c)
- return a:lerp(b,c)
- end
- --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
- --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
- --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
- --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
- TC.C0 = TCF
- HC.C0 = HCF
- RW.C0 = RWF
- LW.C0 = LWF
- --Idle Clerp--
- ITCF = CFrame.fromEulerAnglesXYZ(0,0,0)
- IHCF = HCF * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0)
- IRWF = RWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-5))
- ILWF = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(5))
- TC.C0 = TCF * ITCF
- HC.C0 = IHCF
- RW.C0 = IRWF
- LW.C0 = ILWF
- del = false
- atkd = false
- AddLegWelds()
- LLW.C0 = LLWF
- RLW.C0 = RLWF + Vector3.new(0,-1,.5)
- --Loop Function--
- walking = false
- toim = 0
- while true do
- wait()
- toim = toim + .1
- TC.C0 = (TCF + Vector3.new(0,3-math.sin(toim),0)) * currcf
- torvel = (chara.HumanoidRootPart.Velocity*Vector3.new(1,0,1)).magnitude
- if torvel < 1 and walking == true and del == false and atkd == false then
- for i = 0,1,.5 do
- wait(.001)
- if del == false then
- currcf = clerp(CFrame.fromEulerAnglesXYZ(math.rad(30),0,0),ITCF,i)
- HC.C0 = clerp(HCF * CFrame.fromEulerAnglesXYZ(math.rad(-30),0,0),IHCF,i)
- RW.C0 = IRWF
- LW.C0 = ILWF
- end
- end
- walking = false
- elseif torvel > 1 and walking == false and del == false and atkd == false then
- for i = 0,1,.5 do
- wait(.001)
- if del == false then
- currcf = clerp(ITCF,CFrame.fromEulerAnglesXYZ(math.rad(30),0,0),i)
- HC.C0 = clerp(IHCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-30),0,0),i)
- RW.C0 = IRWF
- LW.C0 = ILWF
- end
- end
- walking = true
- else
- end
- TC.C0 = (TCF + Vector3.new(0,3-math.sin(toim),0)) * currcf
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement