Is there a way to make a specific weapon that doesn't have a joint attached to a character?


Hey, I was working on a third-person animation for a game using a rig, but I’m having an issue. If you can see this video, it was the direct result of this script section:

game.ReplicatedStorage.Events.LoadSlot.OnServerEvent:Connect(function(player, item, FireSoundID, SlidePullSoundID, SlideReleaseSoundID)
if player.Character then
	local weapons = game.ReplicatedStorage.Weapons
	for i,v in pairs(player.Character:GetChildren()) do
		if v:IsA("Model") and weapons:FindFirstChild(v.Name) then
			v:Destroy()
		end
	end
	if weapons:FindFirstChild(item) then
		local gun = weapons:FindFirstChild(item):Clone()
		gun.Parent = player.Character
		local joint = Instance.new("Motor6D")
		joint.Parent = gun
		joint.Part0 = player.Character:FindFirstChild("RightHand")
		joint.Part1 = gun.PrimaryPart
	end
	end
end

end)

It works on other weapons, but I want to modify this script to exclude specific weapons based on their firemode from the module script, particularly bolt actions or names of a specific weapon.

Is there a way for me to do that?

Thanks, and let me know if you need other scripts.

Have you looked into welding the weapon to the UpperTorso for those specific weapons? Going this route would involve the need to modify the animation though.

Update: Everything has been resolved now. I have discovered a new method and it works now.

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