TagAPI:SendSystemMessage
The TagAPI:SendSystemMessage method sends a system-wide message to all players (or specific players) using a designated system tag. These messages appear in chat with special formatting and can be filtered by players through their client settings.
Overview
Serverboolean, stringSyntax
local success, message = TagAPI:SendSystemMessage(messageName: string, systemTag: string, messageContent: string)
| Parameter | Type | Description |
|---|---|---|
messageName |
string |
Unique identifier for this message type (e.g., "ServerRestart", "EventStart") |
systemTag |
string |
System tag to use (must be defined in Config.SystemTags: "System", "Alert", "Info", "Success", "Error") |
messageContent |
string |
The text content of the message |
Return Values
| Return | Type | Description |
|---|---|---|
success |
boolean |
True if message was sent successfully, false otherwise |
message |
string |
Descriptive message about the operation result |
Basic Usage
Send a basic system message to all players.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CCTFF = require(ReplicatedStorage:WaitForChild("CCTFF"))
local TagAPI = CCTFF.TagAPI
local success, msg = TagAPI:SendSystemMessage(
"WelcomeMessage",
"System",
"Welcome to the game!"
)
if success then
print("System message sent")
else
print("Error: " .. msg)
end
Server Announcement
Broadcast server-wide announcements.
local function announceServerRestart(minutesUntil)
local message = "Server will restart in " .. minutesUntil .. " minutes!"
TagAPI:SendSystemMessage(
"ServerRestart",
"Alert",
message
)
end
-- Announce 5 minutes before restart
announceServerRestart(5)
Event Notifications
Notify players about game events.
local function startEvent(eventName)
TagAPI:SendSystemMessage(
"EventStart",
"Success",
"๐ " .. eventName .. " has started! Join now for rewards!"
)
end
local function endEvent(eventName, winner)
TagAPI:SendSystemMessage(
"EventEnd",
"Info",
eventName .. " has ended. Winner: " .. winner
)
end
startEvent("Double XP Weekend")
endEvent("PVP Tournament", "Player123")
Error Messages
Display error or warning messages to all players.
local function notifyDataStoreError()
TagAPI:SendSystemMessage(
"DataStoreError",
"Error",
"โ ๏ธ Data saving temporarily unavailable. Progress may not be saved."
)
end
notifyDataStoreError()
Achievement Broadcasts
Broadcast when players achieve milestones.
odede>local function broadcastAchievement(player, achievementName)
local message = "๐ " .. player.Name .. " unlocked " .. achievementName .. "!"
TagAPI:SendSystemMessage(
"Achievement_" .. achievementName,
"Success",
message
)
end
broadcastAchievement(player, "Master Explorer")
Shop Updates
Notify about new items or sales.
local function announceNewItem(itemName, price)
TagAPI:SendSystemMessage(
"NewShopItem",
"Info",
"๐๏ธ New item available: " .. itemName .. " - Only " .. price .. " coins!"
)
end
local function announceSale(discount)
TagAPI:SendSystemMessage(
"ShopSale",
"Alert",
"๐ฐ " .. discount .. "% OFF SALE! Limited time only!"
)
end
announceNewItem("Legendary Sword", 5000)
announceSale(50)
Scheduled Messages
Send messages at specific intervals.
local TIP_MESSAGES = {
"๐ก Tip: Collect daily rewards for bonus coins!",
"๐ก Tip: Complete quests to level up faster!",
"๐ก Tip: Join a guild for exclusive benefits!",
"๐ก Tip: Visit the shop for powerful upgrades!"
}
local function startTipRotation()
task.spawn(function()
local index = 1
while true do
TagAPI:SendSystemMessage(
"GameTip",
"Info",
TIP_MESSAGES[index]
)
index = index % #TIP_MESSAGES + 1
task.wait(300) -- Every 5 minutes
end
end)
end
startTipRotation()
Player Milestones
Announce when players reach significant levels.
local MILESTONE_LEVELS = {10, 25, 50, 100, 250, 500}
player.leaderstats.Level.Changed:Connect(function(newLevel)
if table.find(MILESTONE_LEVELS, newLevel) then
TagAPI:SendSystemMessage(
"LevelMilestone",
"Success",
"โญ " .. player.Name .. " reached Level " .. newLevel .. "!"
)
end
end)
Update Notifications
Inform players about game updates.
local function announceUpdate(version, features)
local message = "๐ฎ Game Update " .. version .. ":\n" .. features
TagAPI:SendSystemMessage(
"GameUpdate_" .. version,
"Info",
message
)
end
announceUpdate("v2.1", "โข New weapons added\nโข Bug fixes\nโข Performance improvements")
Competition Results
Display competition winners and results.
local function announceWinner(competitionName, winner, prize)
local message = "๐ " .. competitionName .. " Winner: " .. winner ..
" | Prize: " .. prize
TagAPI:SendSystemMessage(
"CompetitionWinner",
"Success",
message
)
end
announceWinner("Weekly PVP Tournament", "ProGamer123", "10,000 Coins")
Maintenance Alerts
Warn about upcoming maintenance.
local function scheduleMaintenanceAlerts(minutesUntil)
local intervals = {60, 30, 15, 5, 1}
for _, interval in ipairs(intervals) do
if minutesUntil >= interval then
task.wait((minutesUntil - interval) * 60)
TagAPI:SendSystemMessage(
"MaintenanceWarning",
"Alert",
"โ ๏ธ Server maintenance in " .. interval .. " minute(s)!"
)
end
end
end
-- Start countdown from 60 minutes
task.spawn(function()
scheduleMaintenanceAlerts(60)
end)
Daily Rewards
Notify about daily reward availability.
local function announceDailyReset()
TagAPI:SendSystemMessage(
"DailyReset",
"Info",
"๐ Daily rewards have reset! Claim your rewards now!"
)
end
-- Call at midnight or daily reset time
announceDailyReset()
Security Alerts
Warn players about security issues.
local function warnExploiter(exploiterName)
TagAPI:SendSystemMessage(
"ExploiterWarning",
"Error",
"๐จ Exploiter detected and removed: " .. exploiterName
)
end
warnExploiter("BadPlayer456")
Welcome Messages
Send welcome message when players join.
odede>game.Players.PlayerAdded:Connect(function(player)
-- Wait for player to load
task.wait(2)
TagAPI:SendSystemMessage(
"PlayerJoin",
"Info",
"๐ " .. player.Name .. " has joined the server!"
)
end)
Conditional Messages
Send messages based on conditions.
local function checkServerLoad()
local playerCount = #game.Players:GetPlayers()
local maxPlayers = game.Players.MaxPlayers
local percentage = (playerCount / maxPlayers) * 100
if percentage >= 90 then
TagAPI:SendSystemMessage(
"ServerLoad",
"Alert",
"โ ๏ธ Server is " .. math.floor(percentage) .. "% full!"
)
end
end
-- Check every minute
while true do
checkServerLoad()
task.wait(60)
end
Rich Text Formatting
Use rich text in system messages.
local function sendFormattedMessage()
local message = 'RED ' ..
'GREEN ' ..
'BLUE'
TagAPI:SendSystemMessage(
"ColorTest",
"System",
message
)
end
sendFormattedMessage()