0

How do I make a "Player died" message?

How do I make a message appear when a player dies? ( Sort of like the script below)

game.Players.PlayerAdded:connect(function(plr)
print(plr.Name.." Has Joined the game")
end)


0
More or less is there a PlayerDied function :) Seeker5123 15 — 7y
0
Do your research, a quick google or wiki search could have gotten you the answer. Perci1 4988 — 7y

2

Died

Roblox has an event that fires whenever a Humanoid 'Dies'. It's exactly as it sounds, it's the 'Died' event.

It's fired when the Health Property of a Humanoid reaches 0 or below.

Directly From The Wiki:

Fired after a character's health reaches 0. Which could be caused either by disconnecting their head from their torso, or directly setting the health property.

You have to bind the event to the Characters Humanoid in order for it to work.

Here is an example of it in code:

game.PlayersPlayerAdded:connect(function(plr)
print(plr.Name .. " has joined the game!")
chr:WaitForChild("Humanoid").Died:connect(function()
print(plr.Name .. " has died!")
end)
end)
end)