Invisible layered clothing on spawn

Im trying to disable, or make layered clothing invisible on spawn (disabling is the best option but i dont think its possible so making it invisible is the best option too)
This script doesnt do it.

i already disabled the checkbox in starterplayerscripts but the 3d clothing still spawns inside the character just small, my game uses size changing mechanics so when im small the clothes are visible and in the way, thats why i want to disable the clothing.

local function onPlayerSpawn(player)
	for _, child in pairs(player.Character:GetChildren()) do
		if child:IsA("Shirt") or child:IsA("Pants") then
			child.Parent = nil
		end
	end
end

game.Players.PlayerAdded:connect(onPlayerSpawn)
1 Like

You need to connect the function to .CharacterAdded, not when the player joins.

New code:

--//Services
local Players = game:GetService("Players")

--//Functions
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if not player:HasAppearanceLoaded() then
			player.CharacterAppearanceLoaded:Wait()
		end
		
		for i, descendant in ipairs(character:GetDescendants()) do
			if descendant:IsA("Shirt") or descendant:IsA("Pants") then
				descendant:Destroy()
			end
		end
	end)
end)
1 Like

hey, I changed the script but the layered clothing was still visible.
Its a server sided script located in workspace, anything wrong on my side or the script?

Why do all my topics get abandoned so quickly, it seems like disabling layered clothing is impossible as I can’t find anything about it and no one can help me do it

It works for me, try adding a wait before destroying the layered clothing.

Does it remove every layered clothing completely? Also, what are the script locations and which sort of script?

It worked for me, and I put the script in ServerScriptService. Just try it for yourself.

1 Like

still happens

image

This code is well but if u mean accessories try:

1 Like

what do you mean with accessories? Does layered clothing go under the category?

Roblox eventually made it as Accessory for Layered Clothing, it doesn’t have it’s own class.

1 Like

Just try that code and show the results

1 Like

i was able to test it, Its the same results as the picture above, the layered clothes still load (the pic is me being small):
image