GroupedAccessoryTypes={}GroupedAccessoryTypes[1]={Enum.AccessoryType.Pants;Enum.AccessoryType.Shorts,Enum.AccessoryType.DressSkirt,Enum.AccessoryType.Waist}GroupedAccessoryTypes[2]={Enum.AccessoryType.TShirt;Enum.AccessoryType.Shirt;Enum.AccessoryType.Sweater}local function u(u,r)local m=ACCESSORY_TYPE_BY_NAME[u]local S=ACCESSORY_TYPE_BY_NAME[r]if m==S then return true end local H=0 local P=0 for u,r in pairs(GroupedAccessoryTypes)do for r,n in pairs(r)do if m==n then H=u end if S==n then P=u end end end if H==P and H~=0 then return true end return false end return u
-- A table to prevent users from equipping multiple clothing items that go in the same "slot".
GroupedAccessoryTypes = {}
GroupedAccessoryTypes[1] = {
	Enum.AccessoryType.Pants,
	Enum.AccessoryType.Shorts,
	Enum.AccessoryType.DressSkirt,
	Enum.AccessoryType.Waist,
}
GroupedAccessoryTypes[2] = {
	Enum.AccessoryType.TShirt,
	Enum.AccessoryType.Shirt,
	Enum.AccessoryType.Sweater,
}

local function usesSameClothingSlot(accessoryTypeName1, accessoryTypeName2)
	local accessoryType1 = ACCESSORY_TYPE_BY_NAME[accessoryTypeName1]
	local accessoryType2 = ACCESSORY_TYPE_BY_NAME[accessoryTypeName2]

	if accessoryType1 == accessoryType2 then
		return true
	end

	local group1 = 0
	local group2 = 0
	for i, accessoryGroup in pairs(GroupedAccessoryTypes) do
		for _, accType in pairs(accessoryGroup) do
			if accessoryType1 == accType then
				group1 = i
			end

			if accessoryType2 == accType then
				group2 = i
			end
		end
	end

	if group1 == group2 and group1 ~= 0 then
		return true
	end

	return false
end

return usesSameClothingSlot
