I am trying to make a respawn system where when the character dies a message is sent to the server via a remote event which removes the character and loads a new one.
I have tried player.Character:Destroy();player.Character:Remove() (which really confuses me) and player:LoadCharacter() but none of them called CharacterRemoving. LoadCharacter only called CharacterAdded.
Player:RemoveCharacter() keeps throwing an error which states that it doesn’t have permission 3. Please could someone explain what permission 3 is.
Also I used LoadCharacter but now the chat doesn’t open when respawning; does anyone know why that is?
I would really like it if all of my questions were answered, specifically the chat problem, any help however will be greatly appreciated.
This says:
“The CharacterRemoving event fires right before a player’s character is removed, such as when the player is respawning.” If this answers your question.
I’ve read that, and what confuses me is that player.Character:Remove() doesn’t fire CharacterREMOVING or that player:RemoveCharacter() is shown in the api-reference as being executable in a script by showing an example, but when attempting to use it in both a local script and a server script, it kept saying (lacking permission 3). So I’m still confused. Is there a method/function that specifically respawns a character in a way that fires CharacterRemoving?
I have realised the problem, when a character script uses CharacterRemoving, it does not have enough time to execute the connected function before both the character and the script (being a descendant of the character) is destroyed.
Therefore, when using CharacterRemoving, the script using the RBXScriptSignal should NOT be in StarterCharacterScripts