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)
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)
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