I've been using compare x to make them. But they glitch sometimes.
You will need to elaborate. What is your problem?
As for falling directly on the player... that would be a set of conditions, up to you to decide what is most suitable.
Thwomp On collision with Player
Thwomp is falling/moving
Player is within Thwomp.width/2 of Thwomp x position
Then do damage
Else (custom movement) Thwomp push player out at angle