How would I make a combat system like this?

I was recently trying to make a combat system simular (inspired by) to Fakewoken where

  • If your weapon is unequipped it stays on your hip/back
  • You can use a special attack when you press R, and feint a normal swing when you right click (Currently using contextactionservice for this)
  • If you swap to another tool the weapon stays in your hand (for abilities)
  • There are different attack styles, for example aerial attack, running attack, and stuff like that.
  • Abilities are automatically used and swap back to your weapon when equipped, I don’t know the best way to make an auto use system
    etc.

But making this system obviously posed a giant problem for me, so I’m asking here if someone can give me a baseline with maybe some examples on the client and server.

One of the limitations I faced is that my weapon models will consist of multiple parts, and I don’t know the best way to animate it with motor6d’s and make dual wields, or weld it to the hip/back.

If anyone could give me a baseline on how to do some of this stuff it would be a big help! I know how to do some of this but I want more optimal methods that aren’t hacky solutions.

Extra Information:

  • I want to use GetPartBoundsInBox hitboxes (Original game uses GetPartsInPart)
  • I’m currently using ContextActionService for most contextual actions.

Will update this as needed.

3 Likes
  • “If your weapon is unequipped it stays on your hip/back”

Put your tool in server storage and have a way of retrieving it. Have an accessory called BackGunAccessory or something like that, just for ease of access. Put all of your parts/meshes, anything that makes the gun look like it does. Add a part called handle, and put it at the center of the gun. Weld all of the parts to the handle using weld constraints and then inside of the handle you should add an attachment, called BodyBackAttachment Exactly. Then write some code like this.

Hierarchy should look this this if everything is done correctly.

image

local clonedtool = tool:Clone()
local clonedtoolonback = serverstorage["BackGunAccessory"]:Clone()
clonedtool.Parent = player.Backpack
	clonedtool.Unequipped:Connect(function()
		for i,v in pairs(clonedtoolonback:GetChildren()) do
			v.Anchored = false
		end
		clonedtoolonback.Parent = player.Character
	end)
	clonedtool.Equipped:Connect(function()
		for i,v in pairs(clonedtoolonback:GetChildren()) do
			v.Anchored = true
		end
		clonedtoolonback.Parent = serverstorage
	end)
1 Like

That’d mean that I’d have to create an accessory for every single tool I create, Is there a better way?

1 Like

I believe there is a way with welding but I don’t exactly remember the method. How To Put Items On A Player's Back? (Like a Sword) I think that link will help you.

Currently I’m using this method of motor6ds and setup for my tools. Should I switch it? It doesn’t seem that compatible with what I’m trying to do here.

I believe motor6ds is one of the main methods for it.

1 Like

Also, is there a way to keep the weapon in the player’s hand for a bit if another tool is unequipped, or keep it from dissappearing with a delay? (For the ability system, it’ll use seperate tools that activate on equip)

Accessories attach weird when rolling and stuff like that.