How I can make Gun Modification System?

I’m making an FPS game, and I want to make Modification System for guns. But, I don’t even know how I can make it with my Gun System. I mean, I have Framework local script that haves a Table with Guns, so when a player joins the game, It finds guns ViewModel in ReplicatedStorage Folder and gives it to the player’s camera. But, how can I make a Modification System using it?

What solutions have you tried so far? I saw a post on how I can Attach modifications to ViewModel. But, I don’t know how to make it using my system.

Here is how my Gun Table looks.

local framework = {
	inventory = {
		"M4A1";
		"Glock41";
		"Knife";
		"Frag";
	};
	module = nil;
	viewmodel = nil;
	currentSlot = 1;
}

If someone can give me some tips or help, it would be really appreciated!

2 Likes

I would use Attachment and preinstall it on my gun model, also with an attribute telling me that what type of attachment can be attached on that Attachment point. Then inside the UI, let’s say you want to equip ACOG scope, its type is a ‘Scope’ so you will need to loop through all attachments inside your model looking for Attachment that has its attribute of ‘Scope’ then you can install it by using WeldConstraint

1 Like

I already said that I know how I can make an Attachment for the modification. I don’t know how to do Equip Modification button using my system.

Yes, and I did give you some tips on how that should be done.

1 Like

Oh yeah sorry, I’ll try to make it.

How I can use WeldConstraint? Like, I need to add it in Modification, and then what?

So, WeldConstraint use Part0 as a main part and Part1 as a connected part. When you create an Attachment on your gun, create a new part on that attachment (let’s call this ‘gunAttachmentPart1’) Then, inside your extra gun attachment you will need to create a primary part in there also. Then you can assemble them by creating a WeldConstraint by setting Part0 to gunAttachmentPart1 and Part1 to the primary part. You can try all this without writing any codes ,just try assembling it first if it works in world space.

1 Like

Thanks, now I know how to make a modification system!

Edit: I used Joints, not WeldConstraint.

1 Like

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