Home / Server

server.broadcast()

server.broadcast(message)

Sends a chat packet to all online players and logs the message to the server console with formatting codes stripped. See Chat colors for the color constants and color.translate().

Parameters

NameTypeDescription
messagestringMessage text. Color codes can be used.

Returns

Nothing.

Example

command('shout', { op = true }, function(sender, args)
  local prefix = color.translate("&c[Shout] &f")
  server.broadcast(prefix .. table.concat(args, " "))
  return true
end)