It’s pretty much all in the title, I’m trying to make the player’s character spawn without their accessories. This is the code I wrote:
game.Players.PlayerAdded:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character.Humanoid
local ClothingFolder = Instance.new("Folder", ReplicatedStorage)
ClothingFolder.Name = Player.Name.."'s ClothingFolder"
for i,Clothing in pairs(Character:GetDescendants()) do
if Clothing:IsA("Pants") or Clothing:IsA("Shirt") or Clothing:IsA("ShirtGraphic") or Clothing:IsA("Accessory") or Clothing:IsA("Decal") then
print("CLothing found")
Clothing.Parent = ReplicatedStorage:WaitForChild(Player.Name.."'s ClothingFolder")
end
end
end)
I used this same code format to do the same thing for another one of my projects and it worked(Though it was through a remote event as opposed to just spawning in without accessories), however it’s not working in this instance. When my character spawns in, my accessories aren’t transferring to the folder created in the replicated storage. There are no errors in the output. What could be the issue and how can I fix it?