For a lot of my scripts in StarterCharacterScripts, I have the event humanoid.Died:Once() which performs a cleanup of the script. However, when I call LoadCharacter(), this doesn’t fire, so I need another way to clean up the scripts.
I’ve tried doing script.Destroying, player.CharacterRemoving, character.Destroying, and character.AncestryChanged, but none of these fire. Before calling LoadCharacter() , I also set the humanoid health to 0 and kept the humanoid.Died event in the starter character scripts, but that didn’t work.
Does anyone know what event I could use or what I can do to clean up the starter character scripts when the player dies/character is respawned?
This sounds like a stupid question, but I can’t find a way to do this.
oh wait i forgot it is a startercharacter script so it wil not fire. I am confused as to what you are trying to do. Any code you put in the startercharater script will run as soon as loadcharater() is called
You cant do this since startercharatcerscripts are destroyed along with the character and created along with the character along with any connections/objects within those scripts.