I am assuming you are attending a school in Missouri, and your temporary residence is with your grandparents, but your permanent address (and the address on your drivers license ) is in Kansas, at your mothers home.
If that is correct, then you can only purchase a handgun in the state of Kansas (your official address).
If you have registered to vote in Missouri and kept your drivers license in Kansas, that may muck up the situation, because then you have a conflict of address. Generally, school addresses are considered non-resident (especially for out of state tuition and fees) and all official correspondence from the school goes to your permanent address (your parents).
Missouri has some real pain in the a## laws for purchasing handguns. When I lived there years ago, you had to take a complete description of the gun to the local police and let them run a criminal check on you as purchaser, and on the gun to make sure it wasn't on a stolen property list, then you had to take two signed letters of character reference on business letterhead paper to the county sheriff to be issued a permit to purchase. I don't know if that has changed any in the last twenty years, but I doubt it.
You should be able to purchase in your home state and transport to your temporary residence, as long as you comply with any local laws at the temporary residence. Since you are living in a private residence and not on school property, that is likely not an issue. Check for any local gun storage laws that may apply. Be sure that when you transport the gun, it is locked in a case, unloaded in chamber and magazine (no loaded magazines/speedloaders anywhere in the vehicle), with the gun case in an inaccesable part of the vehicle, with ammo in a seperate container in a different part of the vehicle.
Good luck and safe shooting.