How to make a weapon combat system? (Solved)

Okay I need help badly. I was going to use a combat system off of YouTube but it won’t work for what I’m trying to achieve.

Roblox Sword Combat Tutorial Part 1 - YouTube

Let me give some backstory. So, I’m making a sci-fi combat game with 4 weapon types. Sword, Axe, Spear, and Hammer. Players can get coins and use those coins to buy skins for their weapons. These skins are actual models. Here’s how the combat system works-

Players have a custom Hotbar with 4 slots

When a player clicks one of these slots it will select the weapon and it’ll appear on their player as “sheathed”. Then a player can press Unsheath to do all the attacks for their weapons. When a player has a weapon unsheathed it’ll disable the ability to select the other weapons in the Hotbar, then reenable it when the weapon is sheathed again.

PROBLEM: In the tutorial the person sets up the system super weird and has everything parented to the one specific model, meaning if I change the model (skin) of a weapon, all those scripts would break. He also has it set up so instead of the weapon being a tool he just does a bunch of cloning and welding and makes you spawn with it welded to your hand. So why is this a problem you ask? Well I don’t want players to auto spawn with the weapon in their hand, only when they Unsheath. And with the setup he has I can’t make it so players can change their skin.

MY IDEA ON A SOLUTION: So, I want it so when players change their skin, it only changes the model itself and all the scripts, hitboxes, systems, etc work just fine without me having to change anything about the scripts. So what’s my solution idea? I was wondering if I could make every weapon a tool itself that a player spawns with then have a specific setup. Instead of the system being parented to the model, it’s parented to the tool. Then everything such as the handle, raycast hit box, the combat scripts, etc parented to the tool itself and not the model like the tutorial. Then when a player equips a different weapon skin it’ll destroy the current model for that tool, clone the new model, check the last cframe of the old model (so it’s all positioned right ig), then weld to the handle.

How would I execute this while using this guy’s system? It checks off all the boxes such as having multiple swing animations, blocking (in part two), etc. Only problems are what I mentioned in this post and the fact he uses a touched event to deal damage (which I can probably fix myself since I wanna use raycasting attachments). Would I be able to implement my system where everything is parented to the tool itself and not the model? Would all the systems still work properly?

I really need help figuring out if this would work and how to execute it properly. This is extremely important as I need this system to work for my game. I have 2 full time devs, multiple contractors (commissioned devs), and really want this game to succeed. We’ve poured a lot of funds into contractors and I don’t want everything to go tumbling down due to an issue like this. Therefore anyone who helps me I will compensate with a few thousand robux & credit in the game for helping with the combat system.

1 Like

well i personally use a hitbox module that was made by @sushimanster and it works really well but u can try to use raycasthitbox clientcast etc for ur combat system

1 Like

Raycast Hitbox 4.01: For all your melee needs! - #1015 by Vesterius3D I’m using this for the hitbox stuff since it’s so simple