Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What would be the best way to make an attack system using hitboxes?

Asked by 5 years ago

I'm trying to make it so when a player attacks with their sword, it plays the animation and it actually does damage to the character, but it's not how I want it to work.

Currently, it just detects when the player clicks with the tool and if the part that the tool touched is the hitbox then it subtracts health by the damage of the tool, is this the best method to go about doing this or is there a more efficient way because it works so far it's just that I don't want it to do a million damage after one click.

Would region3 be a possible solution or what method would you use to create something like this?

0
Your solution is probably for the best as is, just add a debounce in your .Touched so that it doesn't do more damage than it's supposed to. saenae 318 — 5y
1
You should make a table filled with players that got hit that swing, it they are in the table don't do damage to them again. Reset the table after each swing so that they can take damage next hit. INOOBE_YT 387 — 5y
0
^ That is a better solution granted that you want it to damage multiple players at once saenae 318 — 5y

Answer this question