Hitboxes and tagging/combat system (SOLVED)

UPDATE:

So I’ve tried to do it myself, starting out with some tutorials on simple punching scripts. It has turned out great so far. I’ve tried 3 different methods: Raycasts, Hitbox, and the MuchachoHitbox module. I’m currently using the last option and I’ve learnt a lot today. Only thing I haven’t achieved from this post is the animation for when the enemy gets hit, but for me that’s minor.

OLD POST

Hey, I’ve been struggling with creating a tag system for my new game idea.

Edit: I’m trying to create the whole thing from scratch, no idea where to start.

So I’ve created 2 animations: Tag animation, Being tagged animation

I want to apply the tag animation when the player left clicks, and of course a hitbox spawns and if they hit a player, the player takes damage. Also for the “getting tagged” animation to play on the player thats getting hit. That’s all I’m trying to really do right now since it seems basic enough to get started, if you can help I would really appreciate it.

And to elaborate, I’m trying to create not a proper tag system (like “youre it”) but instead more of a combat system with just one function right now, so that if you left click it punches/tags and takes 50 dmg (so 2 hits each). I’m not expecting you to expect me to expect a script to copy and paste, I just need pointers and help. Though if someone does provide a script with explanation that would also definitely help. Thanks for reading :slight_smile:

Please keep in mind I’m a very beginner scripter and only know the basics. I don’t know anything advanced so sorry if I don’t understand what you’re talking about when it comes to the replies.

2 Likes

This seems like a very broad question, what exactly do you need help with? Playing animations? Handling hitboxes? Handling damage? I’d recommend just looking up a guide on how to make a combat system on Youtube which should help a lot if that’s what you’re trying to make

If you just need a very simplified guide, it’s basically:

  • Listen for player input using UserInputService or ContextActionService
  • Use a remote event to request an attack (in case you’re doing serversided hitboxes) a request to attack (“tag”)
  • Get players/humanoids hit using whatever your preferred hitboxing method is (Spatial query, raycasting, etc…)
  • Play the “tagged” animation and make them take damage when they get hit (using Humanoid:TakeDamage, for example)

I over-simplified the entire process, so look up a guide for it if you can’t figure out how to do each thing properly

1 Like

Honestly everything. My bad for not being specific, but basically all of that. I’ve only done the animations and have no clue where to start with the scripts. Thanks for the simplified guide though I’ll check it out!

1 Like

Check post for solution! After hours I’ve found it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.