There's currently no flawless way of doing it as far as I'm aware. Blocks that are set to be both a slope and a semi-solid have collision issues with NPCs (typically they fall through from above and aren't able to pass through from below), and there are also some janky interactions with the player. MrDoubleA's seesaw platforms (part of his
NPC pack) library addresses the aforementioned, but has a bug where the player may fall through when they jump on semi-solid slopes affected by the code, which I don't believe has been fixed yet.