If I recall correctly, karma is constituted of two parts - action and intention. Which means if one wishes to "gain" positive karma, one would have to conduct a positive action AND do so with a positive mind. With that being said, if I were to help an old lady to cross the street for the sole purpose of obtaining good karma, am I going to get good karma?
Karma is how this world behaves. As an example in general how world behave is ; if we change the state of a weight (put a stone from the ground on the table) to a more unstable position (being on the table is more unstable than being on the ground) what would happen? Once its got a chance it comes to a stable position right? You can name this as gravity or any other concept in Science. The same model is happening in Karma too.
By helping a lady to cross the road you are changing the state, and once the nature got a chance it gives you similar thing back. But main thing to remember is that ‘chethana han bikkha wè kamman wadami’ means thought (intention) is the karma. So if you do this without the intention of really helping that lady, you will not get similar help in future. The intention you meant here may cause you to be used by someone else (as return karma) to get what they want while you will feel some easiness.