Script giving problems

I am having problems with a 3d outfit giver script
script

function onPlayerRespawned(newPlayer)
	local armor = game.ReplicatedStorage.Uniform:Clone()
	armor.Parent = newPlayer.Character

	for index, armorParts in pairs(armor:GetChildren()) do
		for index, playerParts in pairs(armor:GetChildren()) do
				if armorParts.Name == playerParts.Name then
				print("no")
				print(armorParts)
				print(playerParts)
					armorParts.PrimaryPart.CFrame = playerParts.CFrame
					local weld = Instance.new("Weld")
					weld.Part0 = playerParts
					weld.Part1 = armorParts.PrimaryPart
					weld.Parent = armorParts.PrimaryPart
				end
			end
		end
end
function onPlayerEntered(newPlayer)
	newPlayer.Changed:Connect(function (property)
		if (property == "Character") then
			onPlayerRespawned(newPlayer)
		end
	end)
end
game.Players.PlayerAdded:Connect(onPlayerEntered)
game.Players.PlayerAdded:Connect(onPlayerRespawned)

output

CFrame is not a valid member of Model "JadtrugamingYT1.Uniform.Head" 

That says it’s a model and not a part which does have a CFrame.

The script is getting the cframe of the primary part of the model

By looking at the error, your “Head” is a model - and you can’t get the CFrame of a model.

1 Like

Ok thank you I will take a look at it

The CFrame property doesn’t exist for “Model” instance, instead you should get the value of the “CFrame” property of the primary part of the “Model” instance.

1 Like