Сначала пытался разобраться сам - не получилось, прибег к помощи ии ассистента в роблокс студио, он выдал такой код: local chatService = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService")) local service = game:GetService("MarketplaceService") local tags = { } chatService.SpeakerAdded:Connect(function(playerName) local speaker = chatService:GetSpeaker(playerName) local player = game.Players[playerName] if player and player.Team then local teamName = player.Team.Name local teamColor = player.Team.TeamColor.Color local teamTag = string.format("[%s] ", teamName) speaker:SetExtraData("NameColor", teamColor) speaker:SetExtraData("Tags", {{TagText = teamTag, TagColor = teamColor}}) end end) Но он не работает. По задумке должен браться цвет и текст команды, в которой находится игрок, и писать её перед ником в чате. Пример: [Команда] Nikvet: сообщение
Скрипт сам переделаешь если нужно: Server-side: local Players = game:GetService("Players") local Teams = game:GetService("Teams") Players.PlayerAdded:Connect(function(player) local function updateTeamAttributes() if player.Team then player:SetAttribute("TeamName", player.Team.Name) else player:SetAttribute("TeamName", nil) end end updateTeamAttributes() player:GetPropertyChangedSignal("Team"):Connect(updateTeamAttributes) end) Код local Players = game:GetService("Players") local Teams = game:GetService("Teams") Players.PlayerAdded:Connect(function(player) local function updateTeamAttributes() if player.Team then player:SetAttribute("TeamName", player.Team.Name) else player:SetAttribute("TeamName", nil) end end updateTeamAttributes() player:GetPropertyChangedSignal("Team"):Connect(updateTeamAttributes) end) Local Script: local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") TextChatService.OnIncomingMessage = function(message) local textSource = message.TextSource if not textSource then return nil end local player = Players:GetPlayerByUserId(textSource.UserId) if not player then return nil end local teamName = player:GetAttribute("TeamName") if teamName then local override = Instance.new("TextChatMessageProperties") override.PrefixText = "[" .. teamName .. "] " .. message.PrefixText return override end return nil end Код local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") TextChatService.OnIncomingMessage = function(message) local textSource = message.TextSource if not textSource then return nil end local player = Players:GetPlayerByUserId(textSource.UserId) if not player then return nil end local teamName = player:GetAttribute("TeamName") if teamName then local override = Instance.new("TextChatMessageProperties") override.PrefixText = "[" .. teamName .. "] " .. message.PrefixText return override end return nil end