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

Execution Context
Server
Script Type
Server Script
Returns
boolean, string
Side Effects
Sends system message to players

Syntax

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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
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.

Lua
local function warnExploiter(exploiterName)
    TagAPI:SendSystemMessage(
        "ExploiterWarning",
        "Error",
        "๐Ÿšจ Exploiter detected and removed: " .. exploiterName
    )
end

warnExploiter("BadPlayer456")

Welcome Messages

Send welcome message when players join.

Lua
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.

Lua
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.

Lua
local function sendFormattedMessage()
    local message = 'RED ' ..
                    'GREEN ' ..
                    'BLUE'
    
    TagAPI:SendSystemMessage(
        "ColorTest",
        "System",
        message
    )
end

sendFormattedMessage()