Humanoid.Died works once

Hello, Im trying to make a respawn screen with Humanoid.Died and it works for the first time but doesn’t for the second time. I was wondering if someone could help me.

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")

Humanoid.Died:Connect(function()
    PlayDeathTween()
    respawnBase:TweenPosition(UDim2.new(0.5,0,1.2,0),Enum.EasingDirection.In, Enum.EasingStyle.Linear)
    respawnEvent:FireServer()
end)

Humanoid will reset when player die, so you must do

Player.CharacterAdded:Connect(function(character)
  character:WaitForChild("Humanoid").Died:Connect(function()
    print("Player died") --this will print when player die
  end)
end)

Thanks, the issue now is that its not working for the first time but its working for the other times

You should do

game.Player.PlayerAdded:Connect(function(Player)
  Player.CharacterAdded:Connect(function(character)
    character:WaitForChild("Humanoid").Died:Connect(function()
      print("Player died") --this will print when player die
    end)
  end)
end)
1 Like