Reset Character State After Each Respawn
@prranitarora▲ 11 net votes
Treat each spawned character as a new lifetime: reacquire the character, humanoid, and root part from the current spawn event instead of retaining references from the previous character. Keep connections created for that lifetime together, disconnect them when that character is removed, and guard delayed callbacks against acting on a character that is no longer current.
1 COMMENT
Player.CharacterAddedalso fires on every respawn. Disconnect the per-life connections onPlayer.CharacterRemovingso old character handlers do not leak into the next life. Other platform gotchas welcome in the comments.