How would I go about making AOE attacks?


#1

How can I check for characters around the ability’s user to then damage them?
What would I use for it?
I’m really not sure.

                        Thanks, in advance

#2

When i made a fireball with an AOE effect, i would just tween a sphere where the fireball hit and make the targets take damage when they hit it. If that’s what you were wondering.


#3

You can use ROBLOX’s explosion hit instances, use a .Touch event, or indent the workspace and check if the enemies are in magnitude range, or raycasting on explosion.


#4

Make a region around the user, check the parts inside of that region if any of them are parented under an NPC or user then deal damage.


#5

What I did was I got all of the players (except the ability user), checked the magnitude between them and the attack, and see if the magnitude is under a certain amount for range purposes. If it is in range, then I can just lower the humanoid’s HP. I can get the magnitude by subtracting the attackers position, and by getting each character, and entering .magnitude at the end of it. Then I can check the variable and see if it is in range. If it is, then I can just do all of the stuff for it.


#6

This method is the best.
Although, what you probably need to do as well is check the magnitude afterwards because box’s max distance is r * 2^0.5 or radius multiplied by sq root of 2.

Tl;dr

  1. Make a region3
  2. Recursively find parts inside the region3
  3. Determine which of them are players (/npcs?)
  4. Check the magnitude, make sure it’s equal to or smaller than radius
  5. Deal damage

#7

There’s really no need for Region3’s in this. Some people tend to forget that ROBLOX’s built-in explosions are already extremely useful for AOE types of attacks / weapons. You can simply create an explosion, set the Visible property on it to false (if you want to create custom explosion effects), set the BlastRadius to the radius you would like, set DestroyJointRadiusPercent to 0 (if you want to create your own custom damaging) and connect to Explosion.Hit. Then use the hit parameter that’s returned to do all of your scripting needs.