Add Shirt If Character Does Not Have Shirt

My script works it adds a shirt to the character if it does not have a shirt, but the issue is it also adds a shirt if you already have one meaning the character now has 2 shirts

game:GetService('Players').PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function()
		plr.CharacterAdded:Wait()
		--// Add Clothing
		if not plr.Character:WaitForChild("Shirt") then
			local shirt = Instance.new("Shirt")
			shirt.Name = "Shirt"
			shirt.Parent = plr.Character
		end
	end)
end)

try this

game:GetService('Players').PlayerAdded:Connect(function(plr)
	player.CharacterAppearanceLoaded:Connect(function(character)
		--// Add Clothing
		if not character:FindFirstChildWhichIsA("Shirt") then
			local shirt = Instance.new("Shirt")
			shirt.Name = "Shirt"
			shirt.Parent = character
		end
	end)
end)
3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.