local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
print(player.Name.." has died!")
end)
I’m assuming this is a local script. PlayerAdded won’t fire since the local player instance has already loaded on the client’s side before the script executes.