All scripts breaking after resetting or dying?

I’m gonna attempt to make this simple to understand as it may be a little confusing. My game utilizes a custom respawn system because I need certain death animations to play before the player actually respawns. To do this, I’ve disabled CharacterAutoLoads. When the player first joins the game, I load them using player:LoadCharacter() and whenever they reset, I keep using that function. Everything works fine inside studio, however when I switch to in-game mode everything goes downhill. The character loads in fine the first time they spawn in and everything goes smoothly. When the player dies or resets, all scripts stop working. The player spawns inside the loading box and nothing happens afterwards.

I have no idea why this is happening and oddly enough, I didn’t have this issue a couple of hours ago. I haven’t touched anything that would cause anything gamebreaking like this. I’ve tried to use print() in certain parts of the script to see if it stops at any point, but no.

I’ve also removed everything from the script besides the custom reset feature. There are no errors in the output.

Help is very much appreciated. :slightly_frowning_face:

I’d also like to add on that the issue still occurs even after removing the custom respawn system. It also happens after removing every single client script, so it’s definitely due to the server script.

player.CharacterRemoving >> Humanoid.Died
The reason this isn’t working is because you’re Doing .CharacterAdded when the players character has already been added. You should instead have a function for everything below characteradded via

myCharacterAdded = function()

end)

Then to combat the issue, you would do

local Character = Player.Character or Player.CharacterAdded:Wait()
myCharacterAdded(Player,Character)
Player.CharacterAdded:Connect(function(Character)
  myCharacterAdded(Player,Character)
end)

If there is still a problem after this then you will need to show me the explorer, Where the script is + Proof of disabling, + Make sure you updated

This partially fixed the problem. Sometimes the character doesn’t load on spawn and the new function just doesn’t seem to fire unless you reset.

In the function there is a part which removes all player packages but I seem to be getting an error now: