Ooh! Sorry I was not understanding. I have encountered this same problem before. The fix I have found is to put this code near the beginning of your script, which relies on AncestryChanged to tell when the character’s parent is no longer nil.
while character.Parent == nil do
character.AncestryChanged:wait()
end
That would not be better. Your’s runs every frame, putting a significant strain on performance, whereas Excess’s only runs when the Parent changes.
In regards to OP, this is an unfortunate consequence of the current avatar loading event order. Currently, the only way to guarantee the character will be fully loaded by the time your script runs is by calling LoadCharacter and waiting for it to return. This should be fixed at some point, and is planned, but for some reason it’s been heavily delayed.
Just a heads up, the while loop isn’t needed since the character’s parent is currently nil. When the character is reparented, its new parent will never be nil.
Very good point. However, I still feel safer using a loop, just in case the event somehow misfired. You are right that it is logicality not necessary though .