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"