I need clothes to change for a regular click on the tooд

I need clothes to change for a regular click on the tool how to write this? who knows?

local tool = script.Parent
local shirtId = 0
local pantId = 0



tool.Activated:Connect(function()
	local char = script.Parent.Parent
	
	if char:FindFirstChild("Shirt") then
		char.Shirt.ShirtTemplate = shirtId
	else
		local newShirt = Instance.new("Shirt")
		newShirt.ShirtTemplate = shirtId
		newShirt.Parent = char
	end
	
	if char:FindFirstChild("Pants") then
		char.Pants.PantsTemplate = pantId
	else
		local newPants = Instance.new("Pants")
		newPants.PantsTemplate = pantId
		newPants.Parent = char
	end
end)
2 Likes