function onClicked(K)print(K.Name)print(K.Parent.Name)if K.Character:findFirstChild("\072\117\109\097\110\111\105\100")~=nil and K.Character:findFirstChild("\067\104\101\115\116")==nil then local D=script.Parent.Parent.Chest:clone()D.Parent=K.Character local C=D:GetChildren()for s=1,#C,1 do if C[s].className=="\080\097\114\116"or C[s].className=="\085\110\105\111\110\079\112\101\114\097\116\105\111\110"or C[s].className=="\077\101\115\104\080\097\114\116"then local K=Instance.new("\087\101\108\100")K.Part0=D.Middle K.Part1=C[s]local N=CFrame.new(D.Middle.Position)local w=D.Middle.CFrame:inverse()*N local P=C[s].CFrame:inverse()*N K.C0=w K.C1=P K.Parent=D.Middle end local N=Instance.new("\087\101\108\100")N.Part0=K.Character.Torso N.Part1=D.Middle N.C0=CFrame.new(0,0,0)N.Parent=N.Part0 end local s=D:GetChildren()for K=1,#s,1 do if s[K].className=="\080\097\114\116"or C[K].className=="\085\110\105\111\110\079\112\101\114\097\116\105\111\110"or C[K].className=="\077\101\115\104\080\097\114\116"then s[K].Anchored=false s[K].CanCollide=false end end end if K.Character:findFirstChild("\072\117\109\097\110\111\105\100")~=nil and K.Character:findFirstChild("\072\101\097\100\103\101\097\114")==nil then local D=script.Parent.Parent.Headgear:clone()D.Parent=K.Character local C=D:GetChildren()for s=1,#C,1 do if C[s].className=="\080\097\114\116"or C[s].className=="\085\110\105\111\110\079\112\101\114\097\116\105\111\110"or C[s].className=="\077\101\115\104\080\097\114\116"then local K=Instance.new("\087\101\108\100")K.Part0=D.Middle K.Part1=C[s]local N=CFrame.new(D.Middle.Position)local w=D.Middle.CFrame:inverse()*N local P=C[s].CFrame:inverse()*N K.C0=w K.C1=P K.Parent=D.Middle end local N=Instance.new("\087\101\108\100")N.Part0=K.Parent.Head N.Part1=D.Middle N.C0=CFrame.new(0,0,0)N.Parent=N.Part0 end local s=D:GetChildren()for K=1,#s,1 do if s[K].className=="\080\097\114\116"or C[K].className=="\085\110\105\111\110\079\112\101\114\097\116\105\111\110"or C[K].className=="\077\101\115\104\080\097\114\116"then s[K].Anchored=false s[K].CanCollide=false end end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- I have seen this script so many times in many free models that
-- I don't know who made this in the first place, I just modified
-- some parts of the script to serve my purposes.

function onClicked(hit)
	print(hit.Name)
	print(hit.Parent.Name)
	if hit.Character:findFirstChild("Humanoid") ~= nil and hit.Character:findFirstChild("Chest") == nil then
		local g = script.Parent.Parent.Chest:clone()
		g.Parent = hit.Character
		local C = g:GetChildren()
		for i = 1, #C do
			if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse() * CJ
				local C1 = C[i].CFrame:inverse() * CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
			local Y = Instance.new("Weld")
			Y.Part0 = hit.Character.Torso
			Y.Part1 = g.Middle
			Y.C0 = CFrame.new(0, 0, 0)
			Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, #h do
			if h[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
				h[i].Anchored = false
				h[i].CanCollide = false
			end
		end
	end

	if hit.Character:findFirstChild("Humanoid") ~= nil and hit.Character:findFirstChild("Headgear") == nil then
		local g = script.Parent.Parent.Headgear:clone()
		g.Parent = hit.Character
		local C = g:GetChildren()
		for i = 1, #C do
			if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse() * CJ
				local C1 = C[i].CFrame:inverse() * CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
			local Y = Instance.new("Weld")
			Y.Part0 = hit.Parent.Head
			Y.Part1 = g.Middle
			Y.C0 = CFrame.new(0, 0, 0)
			Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, #h do
			if h[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
				h[i].Anchored = false
				h[i].CanCollide = false
			end
		end
	end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
