Death Alert

ServerScriptService

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")


game:GetService('Players').PlayerAdded:Connect(function(player)

player.CharacterAdded:Connect(function(character)

character:WaitForChild("Humanoid").Died:Connect(function()

remoteEvent:FireAllClients(player.Name)

end)

end)

end)

StarterPlayerScripts (LocalScript)

local ReplicatedStorage = game:GetService('ReplicatedStorage')

local remoteEvent = ReplicatedStorage:WaitForChild('RemoteEvent')


textColor = BrickColor.new('Really red')


local function welcome(playerName)

game.StarterGui:SetCore('ChatMakeSystemMessage', {

Text = playerName..' has died';

Font = Enum.Font.SourceSansBold;

Color = textColor.Color;

FontSize = Enum.FontSize.Size24;

})

end


remoteEvent.OnClientEvent:Connect(welcome)


StarterPlayerScripts (LocalScript) Random Messages

Add your custom messages to the list (death_messages)

Make sure to put the message inside quotation marks, and put a space at the beginning.

Separate additional messages with a comma

Update the Text variable to what you see below

local ReplicatedStorage = game:GetService('ReplicatedStorage')

local remoteEvent = ReplicatedStorage:WaitForChild('RemoteEvent')


local death_messages = {' has died', ' has oofed', ' is a noob', ' took an L', ' is not longer with us'}


textColor = BrickColor.new('Really red')


local function welcome(playerName)

game.StarterGui:SetCore('ChatMakeSystemMessage', {

Text = playerName.. death_messages[math.random(1, #death_messages)];

Font = Enum.Font.SourceSansBold;

Color = textColor.Color;

FontSize = Enum.FontSize.Size24;

})

end


remoteEvent.OnClientEvent:Connect(welcome)