Why isn't the part welding to the character

Hello Developers.

I been working on a new football league and while we were adding handwarmers. There was a bug with the handwarmers that I couldn’t fix. Help me find a solution.

The Bug:

Code:

event.OnServerEvent:Connect(function(player, arg)
	if arg[1] == 'Handwarmer' then
		local Color = arg[2]
		local Folder = ReplicatedStorage.HandwarmerTypes.HandWarmer
		if player and player.Character then
			for _,v in pairs(player.Character:GetChildren()) do
				if v:IsA('Hat') then
					v:Destroy()
					end
				end
			end
		end
		local char = player.Character:GetChildren()
		for i =1, #char do
		if char[i].Name == 'Handwarmer' then
			char[i]:remove()
		end
	end
	local Color = arg[2]
	local Folder = ReplicatedStorage.HandwarmerTypes.HandWarmer:Clone()
	local Handwarmer = Folder
	local TorsoD6 = Handwarmer.Handle.Torso6D
	Handwarmer.Handle.Warmer.TextureID = 'rbxassetid://' .. Color
	Handwarmer.Name = 'Handwarmer'
	Handwarmer.Parent = player.Character
	TorsoD6.C0 = Handwarmer.Handle
	TorsoD6.C1 = player.Character.Torso
end)

Can you please put some prints in the script to show us where it is failing.

I’m going to assume you haven’t attempted any basic debugging to find the error yourself.

First of all, are there any output errors pertaining to this script?

Theres no errors when I press the ui thats gives me the Handwarmer

In understand that but where in the script is it failing.
In other words does it execute all the statements you expect it to to achieve what you want.
Just put a print in where ever the code path or variable has changed.