Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lp = game.Players.LocalPlayer
- local chr = lp.Character
- local mouse = lp:GetMouse()
- function lerp(a,b,c)return a+(b-a)*c end
- function lerp2(a,b,c)return a*(1-c)+b*c end
- function clerp(c1,c2,al,x) --Smooth Animation!
- local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
- for i,v in pairs(com1) do if x == true then com1[i] = lerp2(v,com2[i],al) else com1[i] = lerp(v,com2[i],al)end end
- return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
- end
- local neck,rootjoint,rs,ls,rh,lh = chr.Torso['Neck'],chr.HumanoidRootPart['RootJoint'],chr.Torso['Right Shoulder'],chr.Torso['Left Shoulder'],chr.Torso['Right Hip'],chr.Torso['Left Hip']
- chr.Humanoid.Animator:Destroy()
- while wait() do
- if Vector3.new(chr.Torso.Velocity.x, 0, chr.Torso.Velocity.z).magnitude > 2 then
- rs.C0=clerp(rs.C0,CFrame.new(1,.5,0)*CFrame.Angles(math.sin(1)*.5,math.rad(90),0),.5)
- ls.C0=clerp(ls.C0,CFrame.new(-1,.5,0)*CFrame.Angles(math.sin(1)*-.5,math.rad(90),0),.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement