You need to Vector X and Vector Y in an angle from the player to the enemy. Something like this:
> Player on collision with Enemy:
local variable a
Set a to angle(Player.x, Player.y, Enemy.x, Enemy.y)
Enemy set Vector X to cos(a)*100
Enemy set Vector Y to sin(a)*100
100 here is the force of the knockback.
Unfortunately, I couldn't get this to work. But I was able to figure out a way that works okay for what i'm going for. I just set the angle towards either the player or the slash, depending on what hit it, and moving it at an angle -180 degrees. I may not be the best but I was able to figure it out. Thanks!