How to check if a player respawned via server script?

Im trying to make it everytime you respawn, your head changes to a different color. I dont know how to detect when the player respawns.

THis is my code

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
	    print("character respawn")
	
    end)
end)
5 Likes

So just say


character:FindFirstChild(“Humanoid”).Died:Connect(function()
player:LoadCharacter()
print(“spawned”)
end)

2 Likes

that looks like your forcing the respawn, and how do you know what the character variable is?

1 Like

Your original code should work. The CharacterAdded event should fire every time the player’s character loads.

3 Likes

You defined it in the script above

1 Like

Yeah, i just sped up the process

1 Like