"What law is that?"
Depends where you are. Most states have laws prohibiting firearms from schoolgrounds.
OK. I have looked unsuccessfully for the federal "safe schools" law that was originally struck down by SCOTUS. I don't know if the federal law exists or, if so, what it says.
The state law here exemps firearms legally carried in your vehicle so long as it is locked.
There's also a federal law. It was thrown out by the Supreme Court once, on the grounds that schools are not commerce and so the Congress has no power to pass such a law. However Congress, in it's infinite Wisdom, sprinkled a little more "Interstate Commerce" pixie dust on it, and passed it again. AFAIK, it's not been back to the Supreme Court for another test.