How to set a custom bodypart to correct orientation?

I have issue every right arm models, whenever i tried to replace a right arm with custom right arm… the orientation is off, I try to fix it. I couldn’t find a solution, I have no idea how to fix this bug.

In this video, you can see the custom right arm orientation is off, I try to rotate the arm to correct
orientation

Custom BodyPart Module :

local module = {}

local rp = game:GetService("ReplicatedStorage")
local weaponsFolder = rp:WaitForChild("Weapons")

function module.Weapons(char, weapons, nameType)
	local WeaponType = weaponsFolder[weapons[nameType]]
		
	for i2, v2 in pairs(WeaponType:GetChildren()) do
		local basePart = char:FindFirstChild(v2.Name)
			
		if basePart then
			local WeaponClone = v2:Clone()
			WeaponClone.Parent = char:FindFirstChild("MonsterInPart")
			WeaponClone:PivotTo(basePart.CFrame * CFrame.new(-0.2,-0.3,0))
			basePart.Transparency = 1
			

			local weld = Instance.new("WeldConstraint", WeaponClone)
			weld.Part0 = WeaponClone.PrimaryPart
			weld.Part1 = basePart
			
			WeaponClone.PrimaryPart.Orientation = basePart.Orientation
		end
	end
end

return module

Server :

local rp = game:GetService("ReplicatedStorage")
local remote = rp:WaitForChild("CharacterSelect")
local WeaponsFolder = rp:WaitForChild("Weapons")
local TypeConfig = require(rp:WaitForChild("CharacterTypeConfig"))
local weaponsModule = require(script:WaitForChild("WeaponModule"))
local AnimModule = require(rp:WaitForChild("AnimModule"))
local weaponsConfig = require(rp:WaitForChild("WeaponTypeConfig"))

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local Murder = char:SetAttribute("Murderer", false)
		local Innocent = char:SetAttribute("Innocent", true)
		
		local CurrentMonster = char:SetAttribute("Monster", "None")
		
		local folder = Instance.new("Folder")
		folder.Name = "MonsterInPart"
		folder.Parent = char
	end)
end)

remote.OnServerEvent:Connect(function(plr, eventType, arg1, arg2)
	local char = plr.Character or plr.CharacterAdded:Wait()
	local root = char:WaitForChild("HumanoidRootPart")
	local hum = char:WaitForChild("Humanoid")
	
	if eventType == "Character" then
		local NameType = arg1
		local RoleType = arg2
		
		weaponsModule.Weapons(char, weaponsConfig, NameType)
		AnimModule.Animation(char, NameType)
				
		local buttonName = TypeConfig[NameType]
			
		if buttonName then
			local MurderValue = char:GetAttribute("Murderer")
			local InnocentValue = char:GetAttribute("Innocent")

			if MurderValue == false and InnocentValue == true then
				char:SetAttribute("Murderer", true)
				char:SetAttribute("Innocent", false)
				char:SetAttribute("Monster", NameType)
			end
		end	
			
		remote:FireClient(plr, "Roles", NameType, RoleType)
	end
end)
1 Like

I spend like 2 hours, tryna figure this out.

1 Like