Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom character meshes not loading on player after joining/respawning?

Asked by 6 years ago
Edited 6 years ago
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)

I have a set of CharacterMesh inside the script, which I want to be put on the character when they join/respawn. However, when a player joins, if they already have a package on their character then they just spawn with their normal package. It works with players without packages. Is their a way to completely stop players packages being spawned, so they are always gonna spawn with my own package?

0
Can’t you just delete all the old CharacterMeshes in the character, add a wait(), and put the new ones in after that? User#20279 0 — 6y
0
Edited the script with what I have. Doesn't work. Player still loads with their package, and it doesn't print the destroyed. My guess is that the packages dont load immediately, so when they spawn it doesnt have anything to remove NinjoOnline 1146 — 6y
0
^ Make the wait longer then? That is if you don’t mind players seeing themselves changing. If you don’t like that though, you can disable CanLoadCharacterAppearance or add a loading screen. User#20279 0 — 6y

Answer this question