I have this script that clones the shirts and pants my mannequin already has and inside the model it has a click detector and I want help changing the script up a bit to make it only clones ONE THING and not both. I tried tweaking it but it just broke the script. Some help would be appreciated. thanks<3.

local Shirt = script.Parent:WaitForChild("Shirt")
local Pants = script.Parent:WaitForChild("Pants")

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	local char = plr.Character or plr.CharacterAdded:Wait()
	for i,v in pairs(char:GetChildren()) do
		if v.ClassName == "Shirt" or v.ClassName == "Pants" then
			v:Destroy()
		elseif v.ClassName == "v" then
			local TheName = string.lower(v.Name)
			if string.find(TheName, "v") then
				--leave it
			else
				v:Destroy()
			end
		end
	end
	Shirt:Clone().Parent, Pants:Clone().Parent = char, char
end)

1 comment

0

can you please clairify?