Left and right hand Weapon System

Hello! I’m a new Developer who just recently taught myself how to code and want to make a game inspired by Madness project NEXUS

I want to create an inventory system based on left-hand and right-hand.

Here’s what I meant

1 hand weapon:
Screenshot_11

A light weapon or a weapon that isn’t too heavy to carry with only one arm can be picked up together with another weapon of the same type (this includes light melee weapon)
However, wielding ranged weapons in both hands simultaneously will result in an accuracy penalty. This penalty (obviously) doesn’t affect melee weapons.

While having a weapon in that certain slot (left or right arm), the player will drop the current weapon if they try to pick up a new one.

2 hand weapon:

As the name suggests these are the weapons that are considered heavy and took both hands to carry (aka worth 2 inventory slots)

If the player is currently holding a 1 hand weapon, they’ll drop it when the heavy weapon is picked up.

Next is the back slot (for heavy weapons) or holster slot (for light weapons)

Screenshot_13

This acts as an extra inventory slot that can be used to store any size of the item but is limited to one item only. Just in case you might need it later

To summarize in short for those who don’t want to read my yapping

I need

  1. 3 inventory slots. 2 for the left and right hand and one in the back
  2. 1 hand(light) weapon can be dual wield
  3. 2 hand(Heavy) weapons take 2 inventory slots and force the player to drop their current weapon to pick it up

this is all thank you to who ever is listening to my idea and if you know how I can achieve this goal
please give me an example or simply point me to something I can study with.

3 Likes

add to the post itself I have some idea of how I can achieve this but I don’t know where to start
for example how do I make a tool take up 2 inventroy slot at once?
or how do I make the custom inventory system

Did you mean, Tetris-Based/Grid inventory System? Something like this
d2f324e587caa07ae3440f4f096698ca156a121d

No, what I mean is that the player will have an invisible item slot
one for each hand and one in the back, light weapons take 1 hand which means you can hold 2 weapons at the same time and ultimately dual wield them and heavy weapons take 2 hands which does the opposite

This probably has something to do with the Hotbar and not the backpack inventory but I don’t know how to modify the inventory system

Hello there new developer. ROBLOX is a platform for kids and because of that its limited and a lot of things are premade and locked behind classes so you cant edit them. For an example the tool class is made for the character to hold it on the right hand. but you can use cframes and weld constraints to attach a pistol mesh/part (Without it being a tool ! !) and to add it when you equip the weapon,
Downside of this is the tool functions and events wont work like Activate(), Activated:Connect() and so on.

there is no way to make a custom grip for the tool?

You can still use tools, but you would have to make a custom function that would delete the grip upon equipping the tool and then apply your own custom Motor6D.

I did this by just firing a remote whenever the client equips their tool, but you can just connect it to .Equipped if you’d like.
I didn’t need dual wielding for my game but you could easily modify this to just take in a target part to apply to.

Here’s what I did:

function RemoteEvent:ToolEquipped(Player: Player, ToolEquipResponse: TypeList.ToolEquipResponse?)
	ToolEquipResponse = ToolEquipResponse or {}
	
	local Character = Player.Character
	local Tool = ToolEquipResponse.Tool
	
	local RightHand = Character:FindFirstChild("RightHand")
	local TargetWeldInstance = ToolEquipResponse.TargetWeldInstance or RightHand
	
	if not TargetWeldInstance then
		return
	end
	
	if not Tool then
		return
	end
	
	local ToolHandle = Tool:FindFirstChild("Handle", true)
	
	if not ToolHandle then
		return
	end
	
	local WeaponGrip = RightHand:FindFirstChild("RightGrip") :: Weld?
	local GripC0 = ToolEquipResponse.GripCFrame
	local GripC1 = CFrame.new()
	
	if WeaponGrip then
		WeaponGrip:Destroy()
	end
	
	local WeaponMotor = Instance.new("Motor6D", TargetWeldInstance)
	WeaponMotor.Name = `{Tool.Name}HandleMotor6D`
	
	WeaponMotor.C0 = GripC0
	WeaponMotor.C1 = GripC1
	WeaponMotor.Part0 = TargetWeldInstance
	WeaponMotor.Part1 = ToolHandle
end

no.

You can use CFrame and attach the part to your left hand.

I know it sucks but that is ROBLOX limitations.

I wouldnt use welds because they are glitchy, i would use weldconstraints

I disagree, motors are pretty powerful, they allow you to animate tool handles as well which lets you do something like, spin a revolver, correct a weapon orientation, etc.

They just take a bit to learn

1 Like

I have an idea for this, it doesn’t require you to use or create a custom inventory system and logic…

But, basically you make 2 Tools. First called “Hand” and Second called “Back”.

If you don’t get it, “Hand” will be the Tools you’re holding in hand and “Back” is gonna be the Tools that’s holstered on your back.

Both Tools will have, no Handle and make sure the “RequiresHandle” property is Turned Off within Both Tools.

Now, since you also want it so that IF the player have guns on both hands, they’ll dual-wield it… It would be quite tricky to do so, and even more complicated.

Basically how it will work is that, in the “Hand” tool there Will be Two Object Values. First one called Left Hand, and Second one called Right Hand. What the Value does is that they basically determine which hand is holding which tool.

Store the Guns inside a Folder in ReplicatedStorage, and make sure the Guns is a Model instead of a Tool. Make sure inside it there’s Settings and Handle Part, Along with the Gun Mesh.

Getting to how it’ll work now, and let’s say… the “Left Hand” Value inside the “Hand” tool is set to a Gun Model inside the Folder inside ReplicatedStorage. When that “Hand” Tool is equipped, it’ll create a Clone of the Gun Model and Parent it into the Player Character, which then welds the Handle inside the Gun Model with the Player Left Hand. As For the Offset, you can Create a CFrameValue inside the Gun Model and set the Motor6D/Weld’s C0/C1 (whichever is set to the Gun Handle) to the Offset CFrameValue. And it’ll do the same thing with the “Right Hand” Value inside the “Hand” tool if the Value isn’t nil/empty. If we do this, if Both “Right Hand” and “Left Hand” Value is set to a Gun, it’ll make it so that the Character Grips Both Gun Model. And as for how to make them Shoot, I’m gonna explain it later when you think you understand what i was trying to say.

1 Like