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)
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.
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!") plr.CharacterAdded:connect(function(chr) chr:WaitForChild("Humanoid").Died:connect(function() print(plr.Name .. " has died!") end) end) end)
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Died