How to make AOE knockback?

So, I want to make an ability that knockbacks players within a certain radius of the player who used the ability. However, I have no idea how to script such an ability. How would I code the knockback?

Sorry if I don’t understand your explanation, I am not an experienced programmer.

  1. Get the centre of your AOE attack
  2. Check the distance between the centre and Players
  3. If they are close enough, add to their Character’s HumanoidRootPart Linear Velocity
  4. To that Linear Velocity apply the Vector that represents a direction which way it should knockback them using the following algorithm
-- ITS A PSEUDO-CODE, DONT JUST COPY PASTE, ITS MADE TO SHOW THE CONCEPT
local direction = PlayerCharacter.HumanoidRootPart.Position - CentreOfAoeSkill
LinearVelocity.Velocity = dir
1 Like