game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for _, v in pairs(character:GetChildren()) do
if v.ClassName == "CharacterMesh" then
v:Destroy()
print("Destroyed: :" .. v)
end
end
wait()
for _, meshes in pairs(script:GetChildren()) do
if meshes.ClassName == "CharacterMesh" then
local mesh = meshes:Clone()
mesh.Parent = character
end
end
end)
end)
Currently I am trying to remove a characters preset package when they join the game. However, it does not remove their package and they still spawn in with their package, not the one I’m cloning in for them. The script works if the player does not have a package (using the default character)
I’ve tried looking through the wiki for something that might be able to help or fix this problem.
ClearCharacterAppearance
I thought would be handy, but that removes everything, which I only want the character meshes to be removed.
Is their a simple way to wait for all the characters assets to have loaded, before deleting them? Or how would I go about waiting for their packages to load before removing them?