I would like to send a message to the chat every time someone dies, but I don't know how to send the message.
function Msg() local Num = math.random(1, #DeathTexts) game.StarterGui:SetCore("ChatMakeSystemMessage", { Text = ("[SERVER] " .. PlrName .. DeathTexts[Num]); Font = Enum.Font.ArialBold; Color = Color3.fromRGB(255, 0, 0); }) end
I tried this but it only works from a local script, therefore only the player that died will see the message.
Solved: Just use FireAllClients() when the user dies, passing the user's name.
This should do.
Place it as a localscript inside of StarterPlayer > StarterPlayerScripts
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", { Text = "Your message here"; Color = Color3.new(0, 0, 255); Font = Enum.Font.SourceSansBold; FontSize = Enum.FontSize.Size24; })