Hmm, this’s weird. Maybe RemoveTable doesn’t have accessory type of this clothing?
There’s some AccessoryTypes that i didn’t put into table
Yea its definitaly a weird case. I’ve struggled with this ever since the release of 3D clothes and haven’t been able to fix it ever. I just left it in, but this is such an annoying part if a person is wearing it.
I agree with you
But i meant, maybe we just need to look into properties of this clothing and add into RemoveTable it’s AccessoryType?
I think the properties you gave were right though, I’ve tried it before in this way, I just can’t get rid of layered clothes anymore in any way, even people that did succeed in it gave me their scripts and that also wouldn’t work
I have another idea. Does your script that you gave at the start removing clothing?
This needs a pause after it, before the for loop, and isn’t them layered ones WrapLayer
for i,v in pairs(char:GetDescendants()) do
if v:IsA("WrapLayer") then
v.Parent.Parent:Destroy() --v.Handle.Accessory
end
end
You could try removing all the layered accessories from the HumanoidDescription and then reapply it?
local players = game:GetService('Players')
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild('Humanoid', 30) :: Humanoid
if not humanoid then
return
end
local description = humanoid:GetAppliedDescription()
local accessories = description:GetAccessories(true)
for i = #accessories, 1, -1 do
local accessoryInfo = accessories[i]
if accessoryInfo and accessoryInfo.IsLayered then
table.remove(accessories, i)
end
end
description:SetAccessories(accessories, true)
humanoid:ApplyDescription(description)
end)
end)
Yes, but it removes everything as in even classic clothing, accessories and so on
Tried it, but now nothing got removed at all
It’s working for me, can you send what you have? Make sure you’re reapplying the description at the end
function RemoveLayeredClothing(player)
player.CharacterAdded:Connect(function(character)
local function RemoveClothing()
for _, item in pairs(character:GetChildren()) do
if item:IsA("Shirt") or item:IsA("Pants") or item:IsA("Accessory") then
item:Destroy()
end
end
end
RemoveClothing()
character:WaitForChild("Humanoid").Changed:Connect(function()
RemoveClothing()
end)
end)
end
game.Players.PlayerAdded:Connect(function(player)
RemoveLayeredClothing(player)
end)
local players = game:GetService('Players')
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild('Humanoid', 30) :: Humanoid
if not humanoid then
return
end
local description = humanoid:GetAppliedDescription()
local accessories = description:GetAccessories(true)
for i = #accessories, 1, -1 do
local accessoryInfo = accessories[i]
if accessoryInfo and accessoryInfo.IsLayered then
table.remove(accessories, i)
end
end
description:SetAccessories(accessories, true)
humanoid:ApplyDescription(description)
end)
end)
with this script it removes but doesn’t apply back.
Try removing the RemoveLayeredClothing function
I did at first, without it nothing happens, nothing gets removed at all
I think we’re stuck.
Can you please show us how this clothes looks in explorer and it’s properties?
Also will be useful information about how this clothes appear in character
I’ll get to this first thing tomorrow, which will be in about 8 hours, it’s past 1 am and I’m very tired, thanks for the help so far!
Is this what you’re looking for?
local WhitelistAttribute = "Whitelisted" -- in case you ever wanna whitelist accessories
local Players = game:GetService("Players")
local function HandleChild(Accessory : Instance)
if Accessory:IsA("Accessory") and Accessory:FindFirstChildWhichIsA("WrapLayer", true) and not Accessory:GetAttribute(WhitelistAttribute) then -- rather lazy way to check but it is what it is
Accessory:Destroy()
warn("Destroying:", Accessory:GetFullName())
end
end
local function initchar(char : Model)
local ChildAdded = char.ChildAdded:Connect(HandleChild)
char.Destroying:Once(function()
ChildAdded:Disconnect()
end)
char:GetPropertyChangedSignal("Parent"):Once(function()
if not char.Parent then
task.delay(5, char.Destroy, char) -- Roblox doesnt automatically destroy the character on removing so I'm just going to delay it by 5 so it wont break any other scripts
end
end)
for i,v in char:GetChildren() do
HandleChild(v)
end
end
local function initplr(plr : Player)
plr.CharacterAdded:Connect(initchar)
end
Players.PlayerAdded:Connect(initplr)
Players.PlayerRemoving:Connect(function(plr : Player)
task.delay(5, plr.Destroy, plr) -- same reason above but in this case for Players
end)
for i,v in Players:GetPlayers() do
initplr(v)
if v.Character then
initchar(v.Character)
end
end
You can also use HumanoidDescriptions to do this. Simple make a reference to the current applied HumanoidDescription of the Humanoid using Humanoid:GetAppliedDescription()
, change the properties Shirt, Pants, and each Accessory type to 0, and use Humanoid:ApplyDescripton(HumanoidDescription)
to apply the new changed HumanoidDescription.
That’s pretty odd. Try seeing if the character exists when the player is added, and try seeing if the playeradded signal is being fired. I will make a demo place later.
The character is completely gone and doesn’t get added back
If you set the avatar mode to R6 via the game settings, it will completely remove R15 items such as layered clothing. But if you already have animations for R15 in your game or just want to use R15, then you don’t have to do this.