Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local angle_origin, vector_origin = Angle(0,0,0), vector_origin
- local offset = Vector(4,0,0)
- hook.Add("PlayerBuildBonePositions", "side_lean", function(ply, bones)
- local vel_world = ply:GetVelocity() vel_world.z = 0
- local vel = WorldToLocal(vel_world, angle_origin, vector_origin, ply:EyeAngles())
- vel.y = math.Clamp(vel.y, -150, 150)
- ply.smooth = (ply.smooth or 0) + ((vel.y - (ply.smooth or 0)) * FrameTime() * 10)
- local pos, ang = ply:GetBonePosition(ply:LookupBone(BONE_PELVIS))
- local side = ply.smooth * -0.121
- ply:SetBonePosition(ply:LookupBone(BONE_PELVIS), pos + Vector(0,0,-math.abs(side*0.05)), ang + Angle(side, 0, 0))
- end)
- hook.Add("UpdateAnimation", "breathe_fix", function(ply)
- if ply:KeyDown(IN_RUN) then ply.breathing_run = math.Clamp((ply.breathing_run or 0) + 1, 0, 50) end
- ply:SetPoseParameter("breathing", ply.breathing)
- ply.breathing_run= math.Clamp((ply.breathing_runor or 0) - (not ply:KeyDown(IN_RUN) and 1), 0, 50)
- end)
Add Comment
Please, Sign In to add comment