I have this in a Server Script:
game.Players.PlayerAdded:connect(function(player)
local died = true
repeat wait() until player.Character
local Humanoid = player.Character:WaitForChild("Humanoid")
Humanoid.Died:connect(function()
died = true -- If player died, change variable
end)
player.CharacterAdded:connect(function(character)
if died then -- If the player died then
print(player.Name .. " has been reapwned!")
died = false
else -- If the player didn't die then
print(player.Name .. " has been loaded!")
died = false
end
end)
end)
Since my game features the ability to refresh your character with :LoadCharacter, this code is supposed to distinguish between loading your character and actually dieing. However when I test it, after death the script distinguishes the respawn as a "load". I think it's because the :Died event is taking to long to activate, but I'm not too sure. Any ideas?

3 comments
You could try checking if the health equals 0 instead of using the Died event.
Does anything come out in the output, like errors or any prints?
No errors. I'll try setting the Health to 0 and see where that gets me.