Forum Discussion
In my experience with making code block based knockback, I found it best to use a boolean at the start of the collision event to prevent it firing multiple times, also worth making sure the player being knocked back is not the same player holding the sword. We can turn the incoming motion of the sword into outgoing motion for the player by multiplying the relative velocity by -1. Taking it a step further, you can multiply this value by a number to scale up the knockback. Then, sending a delayed event to reset the boolean, you'll be set!
One important note: you'll want to be sure 'Custom Player Motion' is toggled on for the world. This can be found in the 'Player Settings' of the world.
It could look something like this when it's all done:
Happy creating!